-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.dev.yml
70 lines (63 loc) · 1.73 KB
/
docker-compose.dev.yml
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
# To configure application environmental variables, place them in .env and update
# .env.example.
#
# When adding environmental variables to this file, always add ":?configure_dotenv"
# to the variable during any occurrence of the variable.
x-common: &common
restart: unless-stopped
read_only: true
x-healthcheck-defaults: &healthcheck-defaults
interval: 15s
timeout: 10s
retries: 2
start_period: 30s
x-env: &env
env_file:
# Use environment from .env first
- .env
# Apply Docker overrides afterwards
- .env.docker
services:
# When adding services, please also update the SERVICES variable in README.md.
database:
image: ${DOCKERHUB:-docker.io}/library/postgres:15
<<: [*common, *env]
healthcheck:
<<: *healthcheck-defaults
test: ["CMD", "pg_isready"]
environment:
POSTGRES_DB: ${POSTGRES_DB:?configure_dotenv}
POSTGRES_USER: ${POSTGRES_USER:?configure_dotenv}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?configure_dotenv}
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- database:/var/lib/postgresql/data
tmpfs:
- /var/run/postgresql
expose:
- "5432"
ports:
# Bind locally to prevent remote access
- 127.0.0.1:5432:5432
app:
image: uselevers-backend:${REGISTRY_TAG:-dev}
depends_on: [database]
build:
context: .
target: dev
<<: [*common, *env]
healthcheck:
# Reduce healthcheck frequency to reduce log noise
interval: 120s
volumes:
- ./uselevers:/app/uselevers:${SRC_RW:-ro}
- ./uselevers/migrations/versions:/app/uselevers/migrations/versions
tmpfs:
- /tmp
expose:
- "80"
ports:
- 7000:80
volumes:
database: {}
# vim: set et ts=2 sw=2: