Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,11 @@ sql/

# READMEs
*.md

# other stuff
*.log
MANIFEST*
Dockerfile

**/__pycache__/**
**/test/**
22 changes: 22 additions & 0 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ jobs:
docker_build:
runs-on: ubuntu-latest

services:
mysql:
image: mysql:8.0.22
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: index_digest
MYSQL_USER: test
MYSQL_PASSWORD: p4ss
ports:
- "53306:3306"
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- uses: actions/checkout@v1

Expand All @@ -23,3 +35,13 @@ jobs:
--cache-from macbre/index-digest:latest \
--tag ${{ github.repository }}
docker images
docker ps

- name: Check the version
run: |
docker run ${{ github.repository }} --version

- name: Run the container and connect to the test database
run: |
docker run --network=host ${{ github.repository }} mysql://test:[email protected]:53306/index_digest | tee /tmp/results
grep "Jolly, good! No issues to report" /tmp/results
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# https://hub.docker.com/_/python/
FROM python:3.9-slim-buster
FROM python:3.9-alpine

WORKDIR /opt/macbre/index-digest

Expand All @@ -9,10 +9,12 @@ ADD indexdigest/__init__.py ./indexdigest/__init__.py

# installs mysql_config and pip dependencies
# https://github.com/gliderlabs/docker-alpine/issues/181
RUN apt-get update && apt-get install -y libmariadb-dev-compat gcc \
RUN apk upgrade \
&& apk add --virtual build-deps gcc musl-dev \
&& apk add mariadb-dev \
&& pip install indexdigest \
&& rm -rf ~/.cache/pip \
&& apt-get remove -y gcc && apt-get autoremove -y
&& apk del build-deps

# install the remaining files
ADD . .
Expand Down