This repository was archived by the owner on Jun 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.dev.yml
More file actions
53 lines (49 loc) · 1.4 KB
/
compose.dev.yml
File metadata and controls
53 lines (49 loc) · 1.4 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
# https://docs.docker.com/compose/compose-file
version: "3.9"
volumes:
# A named volume for the Node modules folder.
# The node_modules folder that's created after "npm install" is run on the
# container will be overridden with an empty node_modules folder because of
# the bind mount we have for the whole project's folder. The node_modules
# folder on the host is empty (doesn't exist), therefore it's mapped to
# an empty folder and overrides the non-empty one.
node_modules:
redis_data:
services:
test:
image: node:18.11.0-bullseye-slim
container_name: fish-species-api-test
command: bash -c "npm install && npm run test:ci"
volumes:
- .:/home/node/app
- node_modules:/home/node/app/node_modules
working_dir: /home/node/app
environment:
- NODE_ENV=test
- CI=true
dev:
image: node:18.11.0-bullseye-slim
container_name: fish-species-api-dev
depends_on:
- redis
restart: unless-stopped
volumes:
- .:/home/node/app
- node_modules:/home/node/app/node_modules
working_dir: /home/node/app
command: bash -c "npm install && npm run dev"
ports:
- "3000:3000"
environment:
- NODE_ENV=development
- PORT=3000
expose:
- "3000"
redis:
image: redis:7.0.5-bullseye
container_name: redis
restart: unless-stopped
volumes:
- redis_data:/data
ports:
- "6379:6379"