-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
145 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
DB_USERNAME=root | ||
DB_ROOT_PASSWORD=1234 | ||
DB_DATABASE=tecst | ||
DB_HOST=mysql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.idea/* | ||
.DS_Store | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
version: "3" | ||
services: | ||
mysql: | ||
container_name: mysql | ||
image: mysql:latest | ||
restart: always | ||
ports: | ||
- "3307:3306" | ||
environment: | ||
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD} | ||
MYSQL_DATABASE: ${DB_DATABASE} | ||
|
||
|
||
|
||
adminer: # db 클라이언트 | ||
container_name: adminer | ||
image: adminer:latest | ||
restart: always | ||
ports: | ||
- "8081:8080" | ||
|
||
redis: | ||
container_name: redis | ||
image: redis | ||
ports: | ||
- "6379:6379" | ||
|
||
springboot: | ||
container_name: springboot | ||
build: . | ||
restart: always | ||
ports: | ||
- "8080:8080" | ||
depends_on: | ||
- mysql | ||
- redis | ||
environment: | ||
WAIT_HOSTS: mysql:3306 | ||
SPRING_DATASOURCE_URL: jdbc:mysql://${DB_HOST}:3306/${DB_DATABASE} | ||
SPRING_DATASOURCE_USERNAME: ${DB_USERNAME} | ||
SPRING_DATASOURCE_PASSWORD: ${DB_ROOT_PASSWORD} | ||
env_file: ./.env | ||
|
||
nginx: | ||
container_name: nginx | ||
build: | ||
dockerfile: dockerfile | ||
context: ./nginx | ||
ports: | ||
- "80:80" | ||
restart: always | ||
depends_on: | ||
- springboot | ||
prometheus: | ||
image: prom/prometheus | ||
container_name: prometheus | ||
volumes: | ||
- ./prometheus.yml:/etc/prometheus/prometheus.yml | ||
command: | ||
- '--config.file=/etc/prometheus/prometheus.yml' | ||
- '--storage.tsdb.path=/prometheus' | ||
- '--web.console.libraries=/usr/share/prometheus/console_libraries' | ||
- '--web.console.templates=/usr/share/prometheus/consoles' | ||
ports: | ||
- "9090:9090" | ||
|
||
grafana: | ||
image: grafana/grafana:latest | ||
container_name: grafana | ||
restart: unless-stopped | ||
links: | ||
- prometheus:prometheus | ||
ports: | ||
- "3000:3000" | ||
user: "1000:1000" | ||
volumes: | ||
- ./data/grafana:/var/lib/grafana | ||
environment: | ||
GF_AUTH_ANONYMOUS_ENABLED: "true" | ||
GF_AUTH_ANONYMOUS_ORG_ROLE: "Admin" | ||
GF_AUTH_DISABLE_LOGIN_FORM: "true" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM nginx | ||
EXPOSE 80 | ||
RUN rm /etc/nginx/nginx.conf | ||
COPY ./nginx.conf /etc/nginx/nginx.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
user nginx; | ||
worker_processes auto; | ||
error_log /var/log/nginx/error.log warn; | ||
pid /var/run/nginx.pid; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
server_tokens off; # 헤더에 NGINX 버전을 숨김 | ||
keepalive_timeout 75; # 접속 시 커넥션 유지 시간 | ||
|
||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
|
||
upstream api { | ||
server spring_boot:8080; | ||
} | ||
|
||
upstream client { | ||
server frontend:3000; | ||
} | ||
|
||
server { | ||
listen 80; | ||
server_name localhost; | ||
charset utf-8; | ||
|
||
location / { | ||
proxy_pass http://client; | ||
} | ||
|
||
location /api { | ||
proxy_http_version 1.1; | ||
proxy_pass http://api; | ||
} | ||
|
||
# location /socket { | ||
# proxy_http_version 1.1; | ||
# proxy_set_header Upgrade $http_upgrade; | ||
# proxy_set_header Connection "upgrade"; | ||
# proxy_set_header Host $host; | ||
# proxy_pass http://docker-server; | ||
# } | ||
} | ||
} |