docker-compose.yml 795 Bytes
Newer Older
1
2
3
version: "3.7"
services:
  frontend:
4
    build: frontend
5
    ports:
6
      - 3000:3000
7
8
9
10
11
12
    stdin_open: true
    volumes:
      - ./frontend:/usr/src/app
      - /usr/src/app/node_modules
    container_name: frontend
    restart: always
13
14
15
    networks:
      - react-express
    depends_on:
16
17
18
19
      - backend

  backend:
    container_name: backend
20
    restart: always
21
    build: backend
22
    volumes:
23
      - ./backend:/usr/src/app
24
25
26
      - /usr/src/app/node_modules
    depends_on:
      - mongo
27
28
29
    networks:
      - express-mongo
      - react-express
30
31
    expose: 
      - 3000
32
33
34
35
36
37
  mongo:
    container_name: mongo
    restart: always
    image: mongo:4.2.0
    volumes:
      - ./data:/data/db
38
39
    networks:
      - express-mongo
40
41
    expose:
      - 27017
42
43
44
networks:
  react-express:
  express-mongo: