-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-commands.txt
65 lines (51 loc) · 1.11 KB
/
docker-commands.txt
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
---------------------
Create Network
---------------------
docker network create goals-net
---------------------
Run MongoDB Container
---------------------
docker run --name mongodb \
-e MONGO_INITDB_ROOT_USERNAME=username \
-e MONGO_INITDB_ROOT_PASSWORD=password \
-v data:/data/db \
--rm \
-d \
--network goals-net \
mongo
---------------------
Build Node API Image
---------------------
docker build -t goals-node .
---------------------
Run Node API Container
---------------------
docker run --name goals-backend \
-e MONGODB_USERNAME=username \
-e MONGODB_PASSWORD=password \
-v logs:/app/logs \
-v "$(pwd):/app" \
-v /app/node_modules \
--rm \
-d \
--network goals-net \
-p 80:80 \
goals-node
---------------------
Build React SPA Image
---------------------
docker build -t goals-react .
---------------------
Run React SPA Container
---------------------
docker run --name goals-frontend \
-v "$(pwd):/app" \
--rm \
-d \
-p 3000:3000 \
-it \
goals-react
---------------------
Stop all Containers
---------------------
docker stop mongodb goals-backend goals-frontend