Added first docker build and compose

This commit is contained in:
CakesTwix 2025-02-05 13:30:25 +02:00
parent 64559d3668
commit d4ed7d9f76
Signed by: CakesTwix
GPG key ID: 7B11051D5CE19825
3 changed files with 35 additions and 1 deletions

24
Dockerfile Normal file
View file

@ -0,0 +1,24 @@
FROM node:23 AS frontend-builder
WORKDIR /app/frontend
COPY frontend/package.json frontend/package-lock.json ./
RUN npm install
COPY frontend ./
RUN npm run build
FROM python:3.12
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
COPY --from=frontend-builder /app/frontend/dist /app/frontend/dist
EXPOSE 5000
CMD ["python", "run.py"]

10
docker-compose.yml Normal file
View file

@ -0,0 +1,10 @@
services:
toloka2webmd3:
build: .
ports:
- "5000:5000"
volumes:
- ./data:/data
- ./instance:/instance
environment:
- FLASK_ENV=production

2
run.py
View file

@ -1,3 +1,3 @@
from app import app from app import app
app.run(port=5000) app.run(host="0.0.0.0", port=5000)