-
-
Notifications
You must be signed in to change notification settings - Fork 74
/
docker-compose.yml
47 lines (43 loc) · 1.04 KB
/
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'
services:
api-example:
build:
context: .
dockerfile: Dockerfile
container_name: api-example
environment:
- DB_HOST=pg-example
- REDIS_HOST=redis-example
volumes:
- ./application:/usr/server/application
depends_on:
- pg-example
- redis-example
ports:
- 127.0.0.1:8000:8000
- 127.0.0.1:8001:8001
- 127.0.0.1:8002:8002
restart: always
pg-example:
image: postgres:16.1-alpine3.19
container_name: pg-example
environment:
- POSTGRES_USER=marcus
- POSTGRES_PASSWORD=marcus
- POSTGRES_DB=application
volumes:
- ./data/postgres/:/var/lib/postgresql/data
- ./database/structure.sql:/docker-entrypoint-initdb.d/1.sql
- ./database/data.sql:/docker-entrypoint-initdb.d/2.sql
ports:
- 127.0.0.1:5432:5432
restart: always
redis-example:
image: redis:7-alpine
container_name: redis-example
ports:
- 127.0.0.1:6379:6379
restart: always
networks:
default:
name: api-example-network