chore: scaffold projet + docker-compose

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-21 21:09:59 +01:00
parent c1fe3e2636
commit 041b96aa60
11 changed files with 71 additions and 0 deletions

5
.env.example Normal file
View File

@@ -0,0 +1,5 @@
BACKEND_PORT=8000
CORS_ORIGINS=http://localhost:5173,http://localhost
DATABASE_URL=sqlite:////data/jardin.db
UPLOAD_DIR=/data/uploads
VITE_API_URL=http://localhost:8000

10
.gitignore vendored Normal file
View File

@@ -0,0 +1,10 @@
data/*.db
data/uploads/
backend/__pycache__/
backend/.venv/
backend/*.pyc
frontend/node_modules/
frontend/dist/
.env
*.egg-info/
.pytest_cache/

7
backend/Dockerfile Normal file
View File

@@ -0,0 +1,7 @@
FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
RUN mkdir -p /data/uploads
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]

0
backend/app/__init__.py Normal file
View File

View File

View File

View File

0
data/.gitkeep Normal file
View File

20
docker-compose.yml Normal file
View File

@@ -0,0 +1,20 @@
services:
backend:
build: ./backend
volumes:
- ./data:/data
ports:
- "8000:8000"
environment:
- DATABASE_URL=sqlite:////data/jardin.db
- UPLOAD_DIR=/data/uploads
- CORS_ORIGINS=http://localhost
restart: unless-stopped
frontend:
build: ./frontend
ports:
- "80:80"
depends_on:
- backend
restart: unless-stopped

11
frontend/Dockerfile Normal file
View File

@@ -0,0 +1,11 @@
FROM node:22-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80

18
frontend/nginx.conf Normal file
View File

@@ -0,0 +1,18 @@
server {
listen 80;
root /usr/share/nginx/html;
index index.html;
location /api/ {
proxy_pass http://backend:8000;
proxy_set_header Host $host;
}
location /uploads/ {
proxy_pass http://backend:8000;
}
location / {
try_files $uri $uri/ /index.html;
}
}