-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
36 lines (36 loc) · 927 Bytes
/
docker-compose.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
services:
app:
build: .
ports:
- "8080:1323"
environment:
DATABASE_URL: postgres://postgres:postgres@db:5432/database?sslmode=disable
depends_on:
db:
condition: service_healthy
db:
platform: linux/x86_64
image: postgres:14.1-alpine
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: database
ports:
- 5432:5432
expose:
- 5432
volumes:
- db:/var/lib/postgresql/data
# Load database schema from ./database.sql
# If you want to reload new database schema, you need to execute
# `docker-compose down --volumes` first to remove the volume.
- ./database.sql:/docker-entrypoint-initdb.d/database.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 3
volumes:
db:
driver: local