This commit is contained in:
root 2025-04-30 17:05:44 +02:00
parent 8a95c116f1
commit 440c413152
4 changed files with 62 additions and 0 deletions

14
backend/Dockerfile Normal file
View File

@ -0,0 +1,14 @@
FROM python:3.10-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
RUN mkdir -p /app/data \
&& chmod +x /app/entrypoint.sh
EXPOSE 8143
ENTRYPOINT ["./entrypoint.sh"]

9
backend/entrypoint.sh Normal file
View File

@ -0,0 +1,9 @@
#!/bin/sh
set -e
if [ -z "$(ls -A /app/alembic/versions)" ]; then
alembic revision --autogenerate -m "Initial migration"
fi
alembic upgrade head
exec uvicorn app.main:app --host 0.0.0.0 --port 8143

31
docker-compose.yml Normal file
View File

@ -0,0 +1,31 @@
services:
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: govorov-backend
restart: unless-stopped
env_file:
- ./backend/.env
environment:
- DATABASE_URL=sqlite:///./data/glass_cutting.db
volumes:
- glass_db:/app/data
ports:
- "8143:8143"
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: govorov-frontend
environment:
- VITE_API_URL:https://govorov.itqop.pw/api
depends_on:
- backend
restart: unless-stopped
ports:
- "4173:4173"
volumes:
glass_db:

8
frontend/Dockerfile Normal file
View File

@ -0,0 +1,8 @@
FROM node:23.11.0-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
EXPOSE 4173
CMD ["npm", "run", "preview", "--", "--host", "0.0.0.0", "--port", "4173"]