Skip to content

Commit d6fc6e3

Browse files
committed
chore(memory-infra): add prod-onPromise setup Elasticsearch and Kibana configs
1 parent d5a5419 commit d6fc6e3

File tree

7 files changed

+90
-59
lines changed

7 files changed

+90
-59
lines changed

http/http-client.env.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"memory_api": "http://localhost:8080"
44
},
55
"development": {
6-
"memory_api": "http://dev.api.mymemory.co.kr"
6+
"memory_api": "https://dev.api.mymemory.co.kr"
77
},
88
"production": {
9-
"memory_api": "http://api.mymemory.co.kr:8080"
9+
"memory_api": "https://api.mymemory.co.kr"
1010
}
1111
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
DB_URL=
2+
DB_USERNAME=
3+
DB_PASSWORD=
4+
AWS_S3_ACCESS_KEY=
5+
AWS_S3_SECRET_KEY=
6+
AWS_S3_BUCKET=
7+
AWS_S3_REGION=
8+
AWS_S3_ENDPOINT=
9+
JWT_TOKEN_SECRET=
10+
ELASTIC_URIS=
11+
ELASTIC_PASSWORD=
12+
# KIBANA_PASSWOD는 추후 통합할 때 필요할듯
13+
# KIBANA_PASSWORD=

memory-infra/docker/prod/ec2/buildspec.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ phases:
2323
AWS_S3_REGION=$(echo $SECRET_VALUES | jq -r '.AWS_S3_REGION')
2424
AWS_S3_ENDPOINT=$(echo $SECRET_VALUES | jq -r '.AWS_S3_ENDPOINT')
2525
JWT_TOKEN_SECRET=$(echo $SECRET_VALUES | jq -r '.JWT_TOKEN_SECRET')
26+
ELASTIC_URIS=$(echo $SECRET_VALUES | jq -r '.ELASTIC_URIS')
27+
ELASTIC_PASSWORD=$(echo $SECRET_VALUES | jq -r '.ELASTIC_PASSWORD')
28+
KIBANA_PASSWORD=$(echo $SECRET_VALUES | jq -r '.KIBANA_PASSWORD')
2629
EOF
2730
2831
build:
Lines changed: 3 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,6 @@
11
version: '3.8'
22

33
services:
4-
elasticsearch:
5-
build:
6-
context: .
7-
dockerfile: ../../local/Dockerfile_Elastic
8-
container_name: memory-elasticsearch-prod
9-
ports:
10-
- "9200:9200"
11-
- "9300:9300"
12-
environment:
13-
- discovery.type=single-node
14-
- xpack.security.enabled=false
15-
- "ES_JAVA_OPTS=-Xms4g -Xmx4g"
16-
- bootstrap.memory_lock=true
17-
- cluster.name=memory-prod-cluster
18-
- node.name=memory-prod-node
19-
volumes:
20-
- ./data/elasticsearch-data:/usr/share/elasticsearch/data
21-
ulimits:
22-
memlock:
23-
soft: -1
24-
hard: -1
25-
nofile:
26-
soft: 65536
27-
hard: 65536
28-
networks:
29-
- memory-network
30-
restart: always
31-
healthcheck:
32-
test: ["CMD-SHELL", "curl -f http://localhost:9200/_cluster/health || exit 1"]
33-
interval: 30s
34-
timeout: 10s
35-
retries: 5
36-
37-
kibana:
38-
image: docker.elastic.co/kibana/kibana:8.17.4
39-
container_name: memory-kibana-prod
40-
ports:
41-
- "5601:5601"
42-
environment:
43-
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
44-
- xpack.security.enabled=false
45-
- SERVER_HOST=0.0.0.0
46-
- SERVER_NAME=kibana-prod
47-
depends_on:
48-
elasticsearch:
49-
condition: service_healthy
50-
networks:
51-
- memory-network
52-
restart: always
53-
healthcheck:
54-
test: ["CMD-SHELL", "curl -f http://localhost:5601/api/status || exit 1"]
55-
interval: 30s
56-
timeout: 10s
57-
retries: 5
58-
594
app:
605
image: 228749872437.dkr.ecr.ap-northeast-2.amazonaws.com/my_memory/memory:latest
616
container_name: my-memory
@@ -75,7 +20,9 @@ services:
7520
CLOUD_AWS_REGION_STATIC: ${AWS_S3_REGION}
7621
CLOUD_AWS_S3_ENDPOINT: ${AWS_S3_ENDPOINT}
7722
JWT_TOKEN_SECRET: ${JWT_TOKEN_SECRET}
78-
SPRING_ELASTICSEARCH_URIS: http://elasticsearch:9200
23+
SPRING_ELASTICSEARCH_URIS: ${ELASTIC_URIS}
24+
SPRING_ELASTICSEARCH_USERNAME: elastic
25+
SPRING_ELASTICSEARCH_PASSWORD: ${ELASTIC_PASSWORD}
7926
networks:
8027
- memory-network
8128
restart: always
@@ -86,4 +33,3 @@ networks:
8633

8734
volumes:
8835
postgres-data:
89-
elasticsearch-data:
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ELASTIC_PASSWORD=
2+
KIBANA_PASSWORD=
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM docker.elastic.co/elasticsearch/elasticsearch:8.17.4
2+
3+
# Nori Analyzer 플러그인 설치
4+
RUN bin/elasticsearch-plugin install analysis-nori
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
version: '3.8'
2+
3+
services:
4+
elasticsearch:
5+
build:
6+
context: .
7+
dockerfile: Dockerfile_Elastic
8+
container_name: memory-elasticsearch-prod
9+
ports:
10+
- "9520:9200"
11+
- "9350:9300"
12+
environment:
13+
- discovery.type=single-node
14+
- xpack.security.enabled=true
15+
- ELASTIC_PASSWORD=${ELASTIC_PASSWORD}
16+
- "ES_JAVA_OPTS=-Xms2g -Xmx2g"
17+
- bootstrap.memory_lock=true
18+
volumes:
19+
- ./data/elasticsearch-data:/usr/share/elasticsearch/data
20+
ulimits:
21+
memlock:
22+
soft: -1
23+
hard: -1
24+
nofile:
25+
soft: 65536
26+
hard: 65536
27+
networks:
28+
- memory-network-prod
29+
restart: always
30+
healthcheck:
31+
test: ["CMD-SHELL", "curl -f http://localhost:9200/_cluster/health -u elastic:${ELASTIC_PASSWORD} --connect-timeout 10 --max-time 10 || exit 1"]
32+
interval: 30s
33+
timeout: 15s
34+
retries: 10
35+
start_period: 60s
36+
37+
kibana:
38+
image: docker.elastic.co/kibana/kibana:8.17.4
39+
container_name: memory-kibana-prod
40+
ports:
41+
- "9651:5601"
42+
environment:
43+
- ELASTICSEARCH_HOSTS=http://elasticsearch:9250
44+
- ELASTICSEARCH_USERNAME=kibana_system
45+
- ELASTICSEARCH_PASSWORD=${KIBANA_PASSWORD}
46+
- xpack.security.enabled=true
47+
depends_on:
48+
elasticsearch:
49+
condition: service_healthy
50+
networks:
51+
- memory-network-prod
52+
restart: always
53+
healthcheck:
54+
test: ["CMD-SHELL", "curl -f http://localhost:5601/api/status -u kibana_system:${KIBANA_PASSWORD} || curl -f http://localhost:5601/api/status || exit 1"]
55+
interval: 30s
56+
timeout: 10s
57+
retries: 5
58+
networks:
59+
memory-network-prod:
60+
driver: bridge
61+
62+
volumes:
63+
elasticsearch-data:

0 commit comments

Comments
 (0)