Merge pull request #147 from xSke/leagues

Update Dockerfile for frontend build
This commit is contained in:
Sakimori 2021-01-13 20:46:25 -05:00 committed by GitHub
commit c141c0a02f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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"]