Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker-compose: use dockerfiles instead of building on startup #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions Dockerfile-back
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM python:3.8-buster
COPY ./server /backend
WORKDIR /backend
RUN pip install -r requirements.txt
RUN mkdir -p /backend/assets/covers /backend/assets/audiobooks
CMD python app.py
6 changes: 6 additions & 0 deletions Dockerfile-front
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM node:14.7-stretch
COPY ./client /frontend
WORKDIR /frontend
RUN npm install
RUN mkdir -p /frontend/public/assets/covers
CMD npm run serve
20 changes: 7 additions & 13 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,35 @@
version: '3'
services:
frontend:
image: node:14.7-stretch
build:
context: .
dockerfile: Dockerfile-front
environment:
- VUE_APP_BACKEND_SCHEME=${TONIE_AUDIO_MATCH_BACKEND_SCHEME}
- VUE_APP_BACKEND_HOST=${TONIE_AUDIO_MATCH_BACKEND_HOST}
- VUE_APP_BACKEND_PORT=${TONIE_AUDIO_MATCH_BACKEND_PORT}
command: >
bash -c "cd /frontend &&
npm install &&
npm run serve"
networks:
- toniebox
ports:
- ${TONIE_AUDIO_MATCH_FRONTEND_PORT}:8080
volumes:
- ./client/:/frontend
- ./albumart/:/frontend/public/assets/covers

backend:
image: python:3.8-buster
build:
context: .
dockerfile: Dockerfile-back
environment:
- TONIE_AUDIO_MATCH_MEDIA_PATH
- TONIE_AUDIO_MATCH_USER
- TONIE_AUDIO_MATCH_PASS
command: >
bash -c "cd /backend &&
pip install -r requirements.txt &&
python app.py"
networks:
- toniebox
ports:
- ${TONIE_AUDIO_MATCH_BACKEND_PORT}:5000
volumes:
- ./server/:/backend
- ./albumart/:/backend/assets/covers
- ${TONIE_AUDIO_MATCH_MEDIA_PATH}:/backend/assets/audiobooks

networks:
toniebox:
toniebox: