-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
62 lines (53 loc) · 1.62 KB
/
Copy pathdocker-compose.yml
File metadata and controls
62 lines (53 loc) · 1.62 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
version: '3.8'
services:
postgres:
image: postgres:15-alpine
container_name: cloud_storage_db
restart: always
environment:
POSTGRES_DB: cloud_storage
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
volumes:
- postgres_data:/var/lib/postgresql/data
- ./database.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- "5432:5432"
backend:
build: .
container_name: cloud_storage_backend
restart: always
depends_on:
- postgres
environment:
# Database
DATABASE_URL: postgresql://postgres:password@postgres:5432/cloud_storage
# MinIO Configuration cho AWS S3
MINIO_ENDPOINT: s3.${AWS_REGION:-ap-southeast-1}.amazonaws.com
MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY}
MINIO_SECRET_KEY: ${MINIO_SECRET_KEY}
MINIO_BUCKET: ${MINIO_BUCKET}
MINIO_SECURE: 'True'
AWS_REGION: ap-southeast-1
# App Config
JWT_SECRET: ${JWT_SECRET}
FLASK_ENV: production
ports:
- "5000:5000"
command: gunicorn --bind 0.0.0.0:5000 --workers 2 --timeout 120 app:app
nginx:
image: nginx:alpine
container_name: cloud_storage_nginx
restart: always
depends_on:
- backend
ports:
- "80:80"
volumes:
- ./index.html:/usr/share/nginx/html/index.html:ro
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
command: ["nginx", "-g", "daemon off;"]
volumes:
postgres_data:
# nguoi dung truy cap vao localhost:80 se duoc chuyen den nginx, sau do nginx se chuyen den backend o cong 5000 nho reverse proxy.
# backend se ket noi den postgres(volume) va aws s3 de luu tru du lieu