-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker_setup_cmd.txt
More file actions
45 lines (40 loc) · 1.41 KB
/
docker_setup_cmd.txt
File metadata and controls
45 lines (40 loc) · 1.41 KB
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
https://www.javainuse.com/devOps/docker/docker-mysql
MySQL Docker:
docker network create lakeapi-mysql
docker container run --name mysqldb --network lakeapi-mysql -e MYSQL_ROOT_PASSWORD=123456 -e MYSQL_DATABASE=ulakedb -d mysql:8
docker container ls
docker container logs -f [id]
docker exec -it mysqldb bash
mysql -u root -p
Spring Boot Docker:
- Create jar file:
mvn clean install -DskipTests
- Build
docker image build -t comlake-api .
- Link
docker container run --network lakeapi-mysql --name comlake-api-container -p 5000:5000 -d comlake-api
- Insert role names into MySQL Docker:
INSERT INTO clake_roles(name) VALUES('ROLE_USER');
INSERT INTO clake_roles(name) VALUES('ROLE_ADMIN');
React Dashboard:
server {
listen 80;
server_name ip example.com www.example.com;
location / {
root /home/user/react-folder/build;
index index.html index.htm;
try_files $uri $uri/ /index.html =404;
}
# serves back end spring boot app default port 8080
location ^~ /api/ {
proxy_pass http://localhost:8080/api/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_cache_bypass $http_upgrade;
}
}