Update Dockerfile and docker-compose for /opt/moto_site structure and reliable Docker deployment

This commit is contained in:
ske087
2025-07-29 02:16:43 +03:00
parent 869a032051
commit 5897ed1cbc
5 changed files with 42 additions and 92 deletions

View File

@@ -2,41 +2,16 @@ version: '3.8'
services:
app:
build: .
build:
context: .
dockerfile: Dockerfile
ports:
- "8100:5000"
environment:
- FLASK_ENV=production
- DATABASE_URL=postgresql://moto_user:moto_pass@db:5432/moto_adventure
- SECRET_KEY=your-super-secret-key-change-this
- DATABASE_URL=sqlite:///moto_adventure.db
- SECRET_KEY=ana_are_mere_si-si-pere_cat-cuprinde_in_cos
working_dir: /opt/moto_site
volumes:
- /opt/moto_uploads:/opt/site/flask-moto-adventure/uploads
depends_on:
- db
- ./uploads:/opt/moto_site/uploads
restart: unless-stopped
db:
image: postgres:15
environment:
- POSTGRES_DB=moto_adventure
- POSTGRES_USER=moto_user
- POSTGRES_PASSWORD=moto_pass
volumes:
- /opt/moto_postgres:/var/lib/postgresql/data
restart: unless-stopped
nginx:
image: nginx:alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- ./uploads:/opt/site/flask-moto-adventure/uploads:ro
depends_on:
- app
restart: unless-stopped
volumes:
postgres_data: