-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
128 lines (124 loc) · 3.33 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
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
version: '3.8'
services:
# monorepo service
monorepo:
# image name and version based on environment variables
image: monorepo-node_v${USE_NODE_VERSION:?}
# container name
container_name: monorepo
# command to run on container startup
command: /bin/bash /init.sh
# build settings
build:
context: docker-assets/monorepo/
dockerfile: Dockerfile
# build arguments based on environment variables
args:
NODE_VERSION: ${USE_NODE_VERSION:?}
USER: ${HOST_USER:?}
UID: ${HOST_UID:?}
GROUP: ${HOST_DOCKER_GROUP:?}
GID: ${HOST_DOCKER_GID:?}
DEBUG: ${DEBUG:-no}
# environment variables for the container
environment:
MONOREPO_ROOT: ${USE_MONOREPO_ROOT:?}
NODE_ENV: ${NODE_ENV:-development}
# working directory inside the container
working_dir: ${USE_MONOREPO_ROOT:?}/
# volumes to mount
volumes:
- ./mono:${USE_MONOREPO_ROOT:?}/
- build_logs:/var/log/monorepo/
- npm_logs:/home/${HOST_USER}/.npm/_logs/
# services that this container depends on
depends_on:
- db_mongo
- redis
# network settings
networks:
- guestnet
ports:
- "4200:4200"
- "3000:3000"
# redis service
redis:
# image name and version
image: redis:bullseye
# container name
container_name: redis-cache
# container hostname
hostname: redis
# command to run on container startup
command: redis-server /usr/local/etc/redis/redis.conf
# system control options
sysctls:
net.core.somaxconn: 1024
# volumes to mount
volumes:
- data_redis:/var/lib/redis
- ./docker-assets/redis/redis.conf:/usr/local/etc/redis/redis.conf
# ports to expose
expose:
- 6379
# network settings
networks:
- guestnet
# user for the container
user: redis:redis
# environment variables for the container
environment:
DEBUG: ${DEBUG:-}
# restart policy for the container
restart: unless-stopped
# db_mongo service
db_mongo:
# container name
container_name: mongo
# container hostname
hostname: db
# command to run on container startup
command: mongod --auth --port 27017 --wiredTigerCacheSizeGB 1.5
# build settings
build:
context: docker-assets/mongo/
dockerfile: Dockerfile
shm_size: 500m
# environment variables for the container
environment:
MONGO_INITDB_ROOT_USERNAME: ${USE_MONGO_USER:?}
MONGO_INITDB_ROOT_PASSWORD: ${USE_MONGO_PASS:?}
MONGO_INITDB_DATABASE: ${USE_MONGO_DB:?}
# volumes to mount
volumes:
- data_db_mongodb:/data/db
- var_lib_mongodb:/var/lib/mongodb
- var_log_mongodb:/var/log/mongodb
ports:
- "27017:27017"
# network settings
networks:
- guestnet
# set ulimit values
ulimits:
nproc: 65535
nofile:
soft: 64000
hard: 128000
# restart policy for the container
restart: unless-stopped
# Specify volumes
volumes:
data_redis:
build_logs:
npm_logs:
data_db_mongodb:
var_lib_mongodb:
var_log_mongodb:
# Specify networks
networks:
guestnet:
ipam:
driver: default
config:
- subnet: 172.16.54.0/24