-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
115 lines (109 loc) · 3.15 KB
/
Copy pathdocker-compose.yml
File metadata and controls
115 lines (109 loc) · 3.15 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
services:
traefik:
image: traefik:v3.3
container_name: traefik
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--entrypoints.web.address=:80"
# - "--entrypoints.websecure.address=:443"
# Automatically redirect HTTP to HTTPS
# - "--entrypoints.web.http.redirections.entryPoint.scheme=https"
# - "--entrypoints.web.http.redirections.entryPoint.permanent=true"
# ACME (Let's Encrypt) configuration:
# - "--certificatesresolvers.myresolver.acme.email=support@tab2fix.com"
# - "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
# - "--certificatesresolvers.myresolver.acme.tlschallenge=true"
ports:
# - "443:443"
- "80:80"
- "8080:8080"
networks:
- app_network
volumes:
- /var/run/docker.sock:/var/run/docker.sock
# - "./letsencrypt:/letsencrypt" # Persist certificates
db:
image: postgres:17.0-alpine
container_name: db_container
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB_NAME}
volumes:
- ./misc/postgres-data:/var/lib/postgresql/data
- ./misc/init.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- "5432:5432"
networks:
- app_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U texagon -d fastapi_db"]
interval: 10s
timeout: 5s
retries: 5
pgadmin:
image: dpage/pgadmin4:latest
container_name: pgadmin_container
environment:
- PGADMIN_DEFAULT_EMAIL=${PGADMIN_DEFAULT_EMAIL}
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD}
- PGADMIN_CONFIG_SERVER_MODE=False
ports:
- "5050:80"
labels:
- "traefik.enable=true"
- "traefik.http.routers.pgadmin.rule=Host(`pgadmin.localhost`)"
- "traefik.http.services.pgadmin.loadbalancer.server.port=80"
volumes:
- ./misc/pgadmin-data:/var/lib/pgadmin
networks:
- app_network
depends_on:
- db
redis:
image: redis:latest
container_name: redis_container
ports:
- "6379:6379"
networks:
- app_network
# fastapi:
# image: fastapi-template
# container_name: fastapi_container
# build:
# context: ./
# dockerfile: Dockerfile
# ports:
# - "8000:8000"
# labels:
# - "traefik.enable=true"
# - "traefik.http.routers.fastapi.rule=Host(`api.localhost`)"
# - "traefik.http.services.fastapi.loadbalancer.server.port=8000"
# env_file:
# - .env
# command: >
# sh -c "sleep 10 && uv run alembic upgrade head &&
# uv run python -m app.commands.create_admin &&
# uv run uvicorn app.main:app --host 0.0.0.0 --port 8000"
# networks:
# - app_network
# depends_on:
# db:
# condition: service_healthy
# traefik:
# condition: service_started
networks:
app_network:
driver: bridge
volumes:
postgres-data:
driver_opts:
o: bind
type: none
device: ./misc/postgres-data
pgadmin-data:
driver_opts:
o: bind
type: none
device: ./misc/pgadmin-data