Skip to content

Commit b76d251

Browse files
committed
update code
1 parent 98892d3 commit b76d251

8 files changed

+186
-1
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ dist/
2323
nbdist/
2424
.nb-gradle/
2525
.elasticbeanstalk
26+
27+
### remove GitPod file ###
28+
*.local

docker-compose.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ services:
88
depends_on:
99
- db
1010
db:
11-
image: mysql
11+
image: mysql:5
1212
restart: always
1313
expose:
1414
- 3306
@@ -17,3 +17,10 @@ services:
1717
- MYSQL_DATABASE=notes_app
1818
- MYSQL_USER=app
1919
- MYSQL_PASSWORD=secretpassword
20+
nginx:
21+
image: java-nginx:ECS-v1
22+
restart: always
23+
ports:
24+
- 80:80
25+
depends_on:
26+
- app

docker/nginx/Dockerfile.nginx.NoSSl

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FROM nginx:alpine
2+
COPY docker/nginx/default.conf.NoSSL /etc/nginx/conf.d/default.conf

docker/nginx/Dockerfile.nginx.SSL

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FROM nginx:alpine
2+
COPY docker/nginx/default.conf.SSL /etc/nginx/conf.d/default.conf

docker/nginx/default.conf.NoSSL

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
server {
2+
listen 80;
3+
server_name devops.aurigastore.com;
4+
server_tokens off;
5+
client_max_body_size 20M;
6+
7+
location / {
8+
try_files $uri @proxy_api;
9+
}
10+
11+
location @proxy_api {
12+
proxy_set_header X-Forwarded-Proto https;
13+
proxy_set_header X-Url-Scheme $scheme;
14+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
15+
proxy_set_header Host $http_host;
16+
proxy_redirect off;
17+
proxy_pass http://app.service.com:8000;
18+
}
19+
}

docker/nginx/default.conf.SSL

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
server {
2+
listen 80;
3+
server_name _;
4+
server_tokens off;
5+
client_max_body_size 20M;
6+
7+
location / {
8+
root /usr/share/nginx/html;
9+
index index.html index.htm;
10+
try_files $uri $uri/ /index.html;
11+
}
12+
13+
location /api {
14+
try_files $uri @proxy_api;
15+
}
16+
location /admin {
17+
try_files $uri @proxy_api;
18+
}
19+
20+
location @proxy_api {
21+
proxy_set_header X-Forwarded-Proto https;
22+
proxy_set_header X-Url-Scheme $scheme;
23+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
24+
proxy_set_header Host $http_host;
25+
proxy_redirect off;
26+
proxy_pass http://backend:8000;
27+
}
28+
29+
location /django_static/ {
30+
autoindex on;
31+
alias /app/backend/server/django_static/;
32+
}
33+
}
+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"requiresCompatibilities": [
3+
"FARGATE"
4+
],
5+
"inferenceAccelerators": [],
6+
"containerDefinitions": [
7+
{
8+
"name": "app",
9+
"image": "rajneeshmehta93/spring-boot:ECS-v4",
10+
"memoryReservation": "128",
11+
"resourceRequirements": null,
12+
"essential": true,
13+
"portMappings": [
14+
{
15+
"containerPort": "8080",
16+
"protocol": "tcp"
17+
}
18+
],
19+
"environment": null,
20+
"environmentFiles": [],
21+
"secrets": null,
22+
"mountPoints": null,
23+
"volumesFrom": null,
24+
"hostname": null,
25+
"user": null,
26+
"workingDirectory": null,
27+
"extraHosts": null,
28+
"logConfiguration": {
29+
"logDriver": "awslogs",
30+
"options": {
31+
"awslogs-group": "/ecs/spring-boot-app",
32+
"awslogs-region": "us-east-1",
33+
"awslogs-stream-prefix": "ecs"
34+
}
35+
},
36+
"ulimits": null,
37+
"dockerLabels": null,
38+
"dependsOn": null,
39+
"repositoryCredentials": {
40+
"credentialsParameter": ""
41+
}
42+
}
43+
],
44+
"volumes": [],
45+
"networkMode": "awsvpc",
46+
"memory": "512",
47+
"cpu": "256",
48+
"executionRoleArn": "arn:aws:iam::597927635090:role/ecsTaskExecutionRole",
49+
"family": "spring-boot-app",
50+
"tags": []
51+
}
+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"requiresCompatibilities": [
3+
"FARGATE"
4+
],
5+
"inferenceAccelerators": [],
6+
"containerDefinitions": [
7+
{
8+
"name": "db",
9+
"image": "mysql:5",
10+
"memoryReservation": "128",
11+
"resourceRequirements": null,
12+
"essential": true,
13+
"portMappings": [
14+
{
15+
"containerPort": "3306",
16+
"protocol": "tcp"
17+
}
18+
],
19+
"environment": [
20+
{
21+
"name": "MYSQL_ROOT_PASSWORD",
22+
"value": "supersecretpassword"
23+
},
24+
{
25+
"name": "MYSQL_DATABASE",
26+
"value": "notes_app"
27+
},
28+
{
29+
"name": "MYSQL_USER",
30+
"value": "app"
31+
},
32+
{
33+
"name": "MYSQL_PASSWORD",
34+
"value": "secretpassword"
35+
}
36+
],
37+
"environmentFiles": [],
38+
"secrets": null,
39+
"mountPoints": null,
40+
"volumesFrom": null,
41+
"hostname": null,
42+
"user": null,
43+
"workingDirectory": null,
44+
"extraHosts": null,
45+
"logConfiguration": {
46+
"logDriver": "awslogs",
47+
"options": {
48+
"awslogs-group": "/ecs/spring-boot-db",
49+
"awslogs-region": "us-east-1",
50+
"awslogs-stream-prefix": "ecs"
51+
}
52+
},
53+
"ulimits": null,
54+
"dockerLabels": null,
55+
"dependsOn": null,
56+
"repositoryCredentials": {
57+
"credentialsParameter": ""
58+
}
59+
}
60+
],
61+
"volumes": [],
62+
"networkMode": "awsvpc",
63+
"memory": "512",
64+
"cpu": "256",
65+
"executionRoleArn": "arn:aws:iam::597927635090:role/ecsTaskExecutionRole",
66+
"family": "spring-boot-db",
67+
"tags": []
68+
}

0 commit comments

Comments
 (0)