-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
85 lines (78 loc) · 2.07 KB
/
docker-compose.yml
File metadata and controls
85 lines (78 loc) · 2.07 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
name: full-stack-fastapi-template-nextjs
# development environment
services:
# Todo: clean up this and test in dev and update traefik-proxy prod
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: full-stack-fastapi-template-nextjs-frontend
restart: unless-stopped
ports:
- 3000:3000
depends_on:
- backend
networks:
- default
backend:
build:
context: ./backend
dockerfile: Dockerfile.dev
container_name: full-stack-fastapi-template-nextjs-backend
restart: unless-stopped
# don't mount alembic as volume
ports:
- 8000:8000
env_file:
- .env
depends_on:
- database
networks:
- default
database:
image: postgres:17.5-alpine3.22
container_name: full-stack-fastapi-template-nextjs-database
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
retries: 5
start_period: 30s
timeout: 10s
# postgres user 999:999 must own the volume
# ok in dev, python watch will complain
user: '${MY_UID}:${MY_GID}'
ports:
- '${POSTGRES_PORT}:5432'
env_file:
- .env
environment:
- PGDATA=/var/lib/postgresql/data/pgdata
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set}
- POSTGRES_USER=${POSTGRES_USER?Variable not set}
- POSTGRES_DB=${POSTGRES_DB?Variable not set}
volumes:
- ./backend/data/database:/var/lib/postgresql/data # !without /pgdata
networks:
- default
adminer:
image: adminer:5.4.0-standalone
container_name: full-stack-fastapi-template-nextjs-adminer
restart: unless-stopped
depends_on:
- database
environment:
- ADMINER_DESIGN=nicu
# no networks, no ports
network_mode: host
# change default port
command: php -S 0.0.0.0:8083 -t /var/www/html
#
# must use database:5432, 5433:5432 mapping does not apply
# ports:
# - 8080:8080
# networks:
# - default
networks:
default:
driver: bridge