Skip to content

Commit ee5c3b4

Browse files
committed
Added workers dockerfile
1 parent 096a3e2 commit ee5c3b4

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ jobs:
3131
- docker build -t docker.pkg.github.com/seluj78/pymatcha/pymatcha-frontend:latest . -f frontend.Dockerfile
3232
# push image
3333
- docker push docker.pkg.github.com/seluj78/pymatcha/pymatcha-frontend:latest
34+
- stage: Build Workers
35+
script:
36+
- openssl aes-256-cbc -K $encrypted_3c84dcdc6bbe_key -iv $encrypted_3c84dcdc6bbe_iv -in .env.enc -out .env -d
37+
# login to github registry
38+
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin docker.pkg.github.com
39+
# build image
40+
- docker build -t docker.pkg.github.com/seluj78/pymatcha/pymatcha-workers:latest . -f workers.Dockerfile
41+
# push image
42+
- docker push docker.pkg.github.com/seluj78/pymatcha/pymatcha-workers:latest
3443
- stage: Test API
3544
before_script:
3645
- node --version

docker-compose.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@ services:
3838
container_name: workers
3939
build:
4040
context: .
41-
dockerfile: backend.Dockerfile
41+
dockerfile: workers.Dockerfile
4242
env_file:
4343
- .env.docker
44-
entrypoint: celery worker --workdir . -A PyMatcha.celery -B --loglevel=info
4544
volumes:
4645
- backend:/backend
4746
depends_on:

workers.Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM python:3.8.3-buster
2+
WORKDIR /www
3+
ADD backend/requirements.txt .
4+
RUN pip install -r requirements.txt
5+
ADD backend .
6+
ENV PYTHONDONTWRITEBYTECODE 1
7+
EXPOSE 5000
8+
ADD .env .
9+
RUN export $(cat .env | xargs)
10+
CMD celery worker --workdir . -A PyMatcha.celery -B --loglevel=info

0 commit comments

Comments
 (0)