-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
65 lines (59 loc) · 1.84 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
version: "3.8"
services:
rn-nginx-proxy:
image: nginx:stable-alpine
container_name: rn-nginx-proxy
ports:
- "3000:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
# restart: 'unless-stopped'
restart: "always"
networks:
- rn-backend
rn-express-server:
build:
context: ./Express
args:
NODE_ENV: development
target: rn-development-build-stage
dockerfile: Dockerfile
container_name: rn-express-server
# Remove volumes in prod because it doesn't respect .dockerignore
volumes:
- /app/node_modules
- ./Express:/app
# restart: 'unless-stopped'
restart: "always"
networks:
- rn-backend
# rn-graphql-server:
# build:
# context: ./Graphql
# args:
# NODE_ENV: development
# target: rn-development-build-stage
# dockerfile: Dockerfile
# container_name: rn-graphql-server
# # Remove volumes in prod because it doesn't respect .dockerignore
# volumes:
# - /app/node_modules
# - ./Graphql:/app
# # restart: 'unless-stopped'
# restart: "always"
# networks:
# - rn-backend
networks:
rn-backend:
driver: bridge
# docker-compose down -v
# keep docker and nginx files in main backend folder and proxy pass to express and graphql. And it seems like the load balancing, microservice and multi container
# 1. docker-compose up => just starts the container/create and starts if new
# 2. docker-compose build => starts container with file changes read => use this when file changes
# 3. docker container prune => removes all stopped containers
# 4. docker exec -it NAME_OF_THE_CONTAINER bash => opens the interactive bash
# 5. docker run -it NAME_OF_THE_IMAGE => run the respective image
#==========================
# UPDATE PACKAGE FREQUENTLY
# USE NODE VERSION 14
#==========================