-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-commands
68 lines (55 loc) · 1.57 KB
/
docker-commands
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
66
67
------------- Docker compose build & Run ----------
docker-compose build
docker-compose up
docker-compose up discovery-server
docker-compose up authentication-server
docker-compose up product-service
..
# Docker compose Stop All Services
docker-compose stop
docker-compose stop product-service
------------ Docker ---------
# Open bash
docker run -it postgresdb /bin/bash
docker run -it authentication-server /bin/bash
docker run -it discovery-server /bin/bash
# Docker Build commands
docker build --tag postgresdb .
docker build --tag authentication-server .
docker build --tag product-service .
docker build --tag order-service .
# Docker Run Commands
docker run -p 5433:5432 postgresdb
docker run -p 8087:8087 authentication-server
docker run -p 8080:8080 product-service
docker run -p 8081:8081 order-service
# Clear all Docker
docker rm $(docker ps -a -q) -f
docker volume prune
# force rebuild
docker build --no-cache --tag postgresdb .
# Register
curl -i -X POST \
-H "Content-Type:application/json" \
-d \
'{
"email": "client",
"firstName": "Mostafa",
"lastName": "Albana",
"password": "123"
}' \
'http://localhost:8087/user/client'
--------------------------------------------------------------
curl -i -X POST \
-H "Content-Type:application/json" \
-d \
'{
"email": "merchant",
"firstName": "Mostafa",
"lastName": "Albana",
"password": "123"
}' \
'http://localhost:8087/user/merchant'
# Login
curl client:123@localhost:8087/oauth/token -d grant_type=client_credentials
curl merchant:123@localhost:8087/oauth/token -d grant_type=client_credentials