-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
47 lines (44 loc) · 965 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
37
38
39
40
41
42
43
44
45
46
47
version: '3.8'
services:
db:
image: postgres:16.2-alpine
container_name: database
volumes:
- db_data:/var/lib/postgresql/data/pgdata
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
environment:
- PGDATA=/var/lib/postgresql/data/pgdata
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=/run/secrets/db_password
- POSTGRES_DB=fss
ports:
- "5432:5432"
secrets:
- db_password
api:
image: fss/api
container_name: backend
build:
context: ./
dockerfile: Dockerfile
ports:
- "80:80"
depends_on:
- db
environment:
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- DB_HOST=${DB_HOST}
- DATABASE_PORT=${DB_PORT}
- DB_NAME=${DB_NAME}
- USERSPACES=${USERSPACES}
env_file:
- .env
volumes:
- user_data:${USERSPACES}
volumes:
db_data:
user_data:
secrets:
db_password:
file: db_password.txt