Update Dockerfile for frontend build

This commit is contained in:
Astrid 2021-01-13 12:56:00 +01:00
parent 8255d838e5
commit 1189fb219a
3 changed files with 23 additions and 4 deletions

6
.dockerignore Normal file
View File

@ -0,0 +1,6 @@
venv/
matteo_env/
__pycache__/
simmadome/node_modules
data/
.git/

2
.gitignore vendored
View File

@ -344,6 +344,7 @@ config.json
games_config.json
weather_config.json
ids
data/
# database
matteo.db
@ -351,5 +352,6 @@ matteo.db-wal
matteo.db-shm
/data/leagues/*
/matteo_env/Lib/site-packages/flask_socketio/__init__.py
Pipfile
env

View File

@ -1,9 +1,20 @@
FROM python:3.8
EXPOSE 5000
# - Build stage 1: frontend (simmadome/ directory)
FROM node:alpine AS frontend
WORKDIR /app
COPY . ./
COPY simmadome/package.json simmadome/package-lock.json ./
RUN npm install
COPY simmadome/ ./
RUN npm run build
# - Build stage 2: backend (Python)
FROM python:3.8
EXPOSE 5000
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . ./
COPY --from=frontend /app/build/ simmadome/build/
CMD ["python", "the_prestige.py"]