-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
98 lines (91 loc) · 2.21 KB
/
Copy pathdocker-compose.yml
File metadata and controls
98 lines (91 loc) · 2.21 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
86
87
88
89
90
91
92
93
94
95
96
97
98
services:
postgres:
image: postgres:15-alpine
container_name: restapi-postgres
restart: always
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./migrations/schema.sql:/docker-entrypoint-initdb.d/01-schema.sql:ro
- ./migrations/seed.sql:/docker-entrypoint-initdb.d/02-seed.sql:ro
networks:
- restapi_network
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
api:
build:
context: .
dockerfile: Dockerfile
container_name: restapi-app
restart: always
ports:
- "3000:3000"
environment:
DB_HOST: postgres
DB_PORT: 5432
DB_USER: ${POSTGRES_USER}
DB_PASSWORD: ${POSTGRES_PASSWORD}
DB_NAME: ${POSTGRES_DB}
DB_SSL: disable
MAIL_HOST: mailhog
MAIL_PORT: 1025
volumes:
- ./certs:/app/certs
depends_on:
postgres:
condition: service_healthy
mailhog:
condition: service_started
networks:
- restapi_network
pgadmin:
image: dpage/pgadmin4:latest
container_name: restapi-pgadmin
restart: unless-stopped
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}
ports:
- "5050:80"
depends_on:
postgres:
condition: service_healthy
networks:
- restapi_network
volumes:
- pgadmin_data:/var/lib/pgadmin
- ./servers.json:/pgadmin4/servers.json
mailhog:
image: mailhog/mailhog:latest
container_name: restapi-mailhog
restart: always
ports:
- "1025:1025" # SMTP Server
- "8025:8025" # Web UI
networks:
- restapi_network
frontend:
build: frontend
container_name: net-inventory-frontend
ports:
- "80:80"
volumes:
- ./frontend:/usr/share/nginx/html
restart: always
networks:
- restapi_network
volumes:
postgres_data:
pgadmin_data:
networks:
restapi_network:
driver: bridge