-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
60 lines (56 loc) · 1.59 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
48
49
50
51
52
53
54
55
56
57
58
59
60
# ----------------------------
# WARNING: DEV MODE ONLY
# This Docker Compose file is not made for production
# Please use the appropriate Dockerfile at the project root for production use
# For more information, refer to the documentation or README of the project
# ----------------------------
networks:
internal:
name: paastech-api-network
services:
node:
image: node:18.16.1-alpine3.18
container_name: paastech-api-node
working_dir: /opt
command: 'npm run start:dev'
# network is in host mode for dev interoperability
# this allows for ORM commands to be run from the host machine
# as the env variables do not need to change from the host to the container
network_mode: host
volumes:
# read-write is necessary for build and use
- ./:/opt:rw
depends_on:
db:
condition: service_healthy
env_file:
- ./.env
db:
image: postgres:15.3-alpine3.18
container_name: paastech-api-db
networks:
- internal
ports:
# publishing the port for the other container to reach
- 5432:5432
volumes:
- ./.db_data:/var/lib/postgresql/data:rw
healthcheck:
test: /usr/local/bin/pg_isready -U api -d paastech
interval: 5s
timeout: 10s
retries: 4
environment:
POSTGRES_DB: paastech
POSTGRES_USER: api
POSTGRES_PASSWORD: api
mail:
image: mailhog/mailhog:v1.0.1
container_name: paastech-api-mail
ports:
- 1025:1025
- 8025:8025
volumes:
- ./.docker/mailhog.auth:/etc/mailhog.auth:ro
environment:
MH_AUTH_FILE: /etc/mailhog.auth