Move frontend
This commit is contained in:
parent
7d51206deb
commit
7ea082fecb
37 changed files with 2993 additions and 3 deletions
66
backend/docker-compose.yml
Normal file
66
backend/docker-compose.yml
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
version: '3.8'
|
||||
|
||||
services:
|
||||
fizika-admin:
|
||||
build:
|
||||
context: ./backend
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- "3001:3001"
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- PORT=3001
|
||||
- FRONTEND_URL=${FRONTEND_URL:-*}
|
||||
volumes:
|
||||
# Mount data files
|
||||
- ./fizika.json:/usr/src/app/fizika.json:ro
|
||||
- ./pics:/usr/src/app/pics
|
||||
# Optional: mount for development
|
||||
# - ./backend:/usr/src/app
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3001/api/fizika', (res) => { process.exit(res.statusCode === 200 ? 0 : 1) }).on('error', () => process.exit(1))"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
|
||||
# Optional: Development service with hot reload
|
||||
fizika-admin-dev:
|
||||
build:
|
||||
context: ./backend
|
||||
dockerfile: Dockerfile
|
||||
target: dev-dependencies
|
||||
ports:
|
||||
- "3001:3001"
|
||||
environment:
|
||||
- NODE_ENV=development
|
||||
- PORT=3001
|
||||
- FRONTEND_URL=*
|
||||
volumes:
|
||||
- ./backend:/usr/src/app
|
||||
- ./fizika.json:/usr/src/app/fizika.json
|
||||
- ./pics:/usr/src/app/pics
|
||||
- /usr/src/app/node_modules
|
||||
command: npm run dev
|
||||
profiles: ["dev"]
|
||||
|
||||
# Optional: Nginx reverse proxy for production
|
||||
nginx:
|
||||
image: nginx:alpine
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
volumes:
|
||||
- ./nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
- .:/usr/share/nginx/html:ro
|
||||
# SSL certificates (if using HTTPS)
|
||||
# - ./ssl:/etc/ssl/certs
|
||||
depends_on:
|
||||
- fizika-admin
|
||||
restart: unless-stopped
|
||||
profiles: ["nginx"]
|
||||
|
||||
networks:
|
||||
default:
|
||||
name: fizika-network
|
||||
Loading…
Add table
Add a link
Reference in a new issue