-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.dev.yml
55 lines (51 loc) · 1.64 KB
/
docker-compose.dev.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
# Compose file for developing
# Creates two separate containers running frontend and backend separately
# Bind mounts to src/ folders to allow for editing in real-time
version: '3.8'
services:
frontend:
build:
context: ./frontend # Build our frontend image. It will find the Dockerfile and build from it
dockerfile: Dockerfile
image: sandsten/portfolio-frontend:dev # If combined with "build". The created image from the build context will be given the name defined at "image"
container_name: frontend
ports:
- 3001:3001 # For webpack-dev-server
- 9229:9229 # For attaching a debuger
command: npm start
environment:
NODE_ENV: development
develop:
watch:
- action: sync
path: ./frontend/src
target: /frontend/src
ignore:
- ./frontend/node_modules
- action: rebuild
path: ./frontend/package.json
# Node backend
# backend:
# build:
# context: ./backend
# dockerfile: Dockerfile
# image: sandsten/portfolio-backend:dev
# container_name: backend
# # depends_on:
# # - mongodb
# ports:
# - 3000:3000
# volumes:
# # Only include the src/ as a bind mount if we want to keep our local folder free of node_modules
# # If we had ./backend:/backend instead, the installed node_modules in in our container would be deleted!
# - ./backend/src:/backend/src
# environment:
# PORT: 3000
# NODE_ENV: development
# DATABASE: remote
# secrets:
# - my_secrets
# command: ['npm', 'run', 'start:dev']
# secrets:
# my_secrets:
# file: ./secrets.txt