-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
97 lines (93 loc) · 3.04 KB
/
docker-compose.yml
File metadata and controls
97 lines (93 loc) · 3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
services:
mongodb:
image: mongo:7
container_name: scandy-mongodb
restart: unless-stopped
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_ROOT_USER:-admin}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_ROOT_PASSWORD:-change_me_immediately}
MONGO_INITDB_DATABASE: ${MONGODB_DB:-scandy}
volumes:
- mongodb_data:/data/db
- ./mongo-init:/docker-entrypoint-initdb.d
networks:
- scandy-network
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
app:
build: .
image: scandy:latest
container_name: scandy-app
restart: unless-stopped
environment:
- DATABASE_MODE=mongodb
- MONGODB_URI=mongodb://${MONGO_ROOT_USER:-admin}:${MONGO_ROOT_PASSWORD:-change_me_immediately}@mongodb:27017/${MONGODB_DB:-scandy}?authSource=admin
- MONGODB_DB=${MONGODB_DB:-scandy}
- FLASK_ENV=${FLASK_ENV:-production}
- SECRET_KEY=${SECRET_KEY:-change_me_secret_key}
- SYSTEM_NAME=${SYSTEM_NAME:-Scandy}
- TZ=${TIMEZONE:-Europe/Berlin}
- SESSION_COOKIE_SECURE=${SESSION_COOKIE_SECURE:-False}
- REMEMBER_COOKIE_SECURE=${REMEMBER_COOKIE_SECURE:-False}
ports:
- "${APP_PORT:-5000}:5000"
volumes:
- app_uploads:/app/app/uploads
- app_backups:/app/app/backups
- app_logs:/app/app/logs
- app_sessions:/app/app/flask_session
depends_on:
mongodb:
condition: service_healthy
networks:
- scandy-network
# - proxy # Uncomment to use with a reverse proxy like Traefik
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
# labels:
# - "traefik.enable=true"
# - "traefik.http.routers.scandy.rule=Host(`scandy.example.com`)"
# - "traefik.http.routers.scandy.entrypoints=websecure"
# - "traefik.http.routers.scandy.tls.certresolver=myresolver"
# - "traefik.http.services.scandy.loadbalancer.server.port=5000"
mongo-express:
image: mongo-express:1.0.0
container_name: scandy-mongo-express
restart: unless-stopped
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: ${MONGO_ROOT_USER:-admin}
ME_CONFIG_MONGODB_ADMINPASSWORD: ${MONGO_ROOT_PASSWORD:-change_me_immediately}
ME_CONFIG_MONGODB_URL: mongodb://${MONGO_ROOT_USER:-admin}:${MONGO_ROOT_PASSWORD:-change_me_immediately}@mongodb:27017/
ME_CONFIG_BASICAUTH_USERNAME: ${ME_BASICAUTH_USER:-admin}
ME_CONFIG_BASICAUTH_PASSWORD: ${ME_BASICAUTH_PASSWORD:-change_me_immediately}
ports:
- "${ME_PORT:-8081}:8081"
depends_on:
mongodb:
condition: service_healthy
networks:
- scandy-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8081"]
interval: 30s
timeout: 10s
retries: 3
volumes:
mongodb_data:
app_uploads:
app_backups:
app_logs:
app_sessions:
networks:
scandy-network:
driver: bridge
# proxy:
# external: true