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
24 changes: 21 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:

jobs:
include:
- stage: build
- stage: Build Backend
script:
- openssl aes-256-cbc -K $encrypted_3c84dcdc6bbe_key -iv $encrypted_3c84dcdc6bbe_iv -in .env.enc -out .env -d
# login to github registry
Expand All @@ -22,7 +22,25 @@ jobs:
- docker build -t docker.pkg.github.com/seluj78/pymatcha/pymatcha-api:latest . -f backend.Dockerfile
# push image
- docker push docker.pkg.github.com/seluj78/pymatcha/pymatcha-api:latest
- stage: test
- stage: Build Frontend
script:
- openssl aes-256-cbc -K $encrypted_3c84dcdc6bbe_key -iv $encrypted_3c84dcdc6bbe_iv -in .env.enc -out .env -d
# login to github registry
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin docker.pkg.github.com
# build image
- docker build -t docker.pkg.github.com/seluj78/pymatcha/pymatcha-frontend:latest . -f frontend.Dockerfile
# push image
- docker push docker.pkg.github.com/seluj78/pymatcha/pymatcha-frontend:latest
- stage: Build Workers
script:
- openssl aes-256-cbc -K $encrypted_3c84dcdc6bbe_key -iv $encrypted_3c84dcdc6bbe_iv -in .env.enc -out .env -d
# login to github registry
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin docker.pkg.github.com
# build image
- docker build -t docker.pkg.github.com/seluj78/pymatcha/pymatcha-workers:latest . -f workers.Dockerfile
# push image
- docker push docker.pkg.github.com/seluj78/pymatcha/pymatcha-workers:latest
- stage: Test API
before_script:
- node --version
- npm --version
Expand Down Expand Up @@ -53,7 +71,7 @@ jobs:
# stop and remove docker to prevent them from block port at next iteration/test
- docker stop $(docker ps -a -q)
- docker rm $(docker ps -a -q)
- stage: lint
- stage: Lint Backend
before_script:
- pip install -r backend/requirements.txt
script:
Expand Down
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ services:
container_name: workers
build:
context: .
dockerfile: backend.Dockerfile
dockerfile: workers.Dockerfile
env_file:
- .env.docker
entrypoint: celery worker --workdir . -A PyMatcha.celery -B --loglevel=info
volumes:
- backend:/backend
depends_on:
Expand Down
10 changes: 10 additions & 0 deletions workers.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM python:3.8.3-buster
WORKDIR /www
ADD backend/requirements.txt .
RUN pip install -r requirements.txt
ADD backend .
ENV PYTHONDONTWRITEBYTECODE 1
EXPOSE 5000
ADD .env .
RUN export $(cat .env | xargs)
CMD celery worker --workdir . -A PyMatcha.celery -B --loglevel=info