flask-server/docker-compose.yml

53 lines
1.0 KiB
YAML
Raw Normal View History

2024-10-13 04:58:48 -04:00
services:
web:
2024-10-13 11:22:17 -04:00
build:
context: .
dockerfile: Dockerfile
2024-10-13 04:58:48 -04:00
ports:
2024-10-13 11:22:17 -04:00
- "127.0.0.1:8000:8000"
2024-10-13 04:58:48 -04:00
volumes:
- ./posters:/app/posters
2024-10-13 11:22:17 -04:00
- ./db:/app/db
- /tmp
tmpfs:
- /tmp
- /run
- /var/log
2024-10-13 04:58:48 -04:00
environment:
- FLASK_SECRET_KEY=${FLASK_SECRET_KEY}
- FLASK_OMDB_KEY=${FLASK_OMDB_KEY}
- FLASK_ADMIN_PASSWORD=${FLASK_ADMIN_PASSWORD}
- FLASK_DATABASE=/app/db/movielist.sqlite
- FLASK_IMAGE_WIDTH=200
env_file:
- .env
2024-10-13 11:22:17 -04:00
user: 952:952
read_only: true
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
cap_add:
- NET_BIND_SERVICE
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000"]
interval: 1m30s
timeout: 30s
retries: 3
start_period: 60s
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
deploy:
resources:
limits:
cpus: '0.50'
memory: 512M
2024-10-13 04:58:48 -04:00
volumes:
posters:
2024-10-13 11:22:17 -04:00
db: