diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..5c484d3 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +venv/ +matteo_env/ +__pycache__/ +simmadome/node_modules +data/ +.git/ \ No newline at end of file diff --git a/.gitignore b/.gitignore index b4a7181..af99f24 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/Dockerfile b/Dockerfile index 75d8a22..fc250eb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"]