Refactor project structure to use Vite with React, add Docker support, and implement Nginx for serving static files

This commit is contained in:
2026-01-31 19:54:36 -03:00
parent 244fa61194
commit 4ac5d13881
11 changed files with 770 additions and 18 deletions

View File

@@ -1,17 +1,17 @@
FROM python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
FLASK_APP=app.py \
FLASK_RUN_HOST=0.0.0.0 \
FLASK_RUN_PORT=5000
FROM node:20-alpine AS build
WORKDIR /app
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY package.json ./
RUN npm install --no-audit --no-fund
COPY . .
RUN npm run build
EXPOSE 5000
CMD ["flask", "run"]
FROM nginx:alpine
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]