Skip to content

Commit

Permalink
fix: 로컬 도커 컴포즈 수정 (nginx 제거)
Browse files Browse the repository at this point in the history
  • Loading branch information
GaBaljaintheroom committed Jan 4, 2024
1 parent 23c62a8 commit 64b3871
Showing 1 changed file with 71 additions and 59 deletions.
130 changes: 71 additions & 59 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,56 +21,86 @@ services:
networks:
- aiary

# mysql:
# container_name: mysql
# image: mysql:latest
# environment:
# MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
# MYSQL_USER: ${MYSQL_USER}
# MYSQL_PASSWORD: ${MYSQL_PASSWORD}
# MYSQL_DATABASE: ${MYSQL_DATABASE}
# command:
# - '--character-set-server=utf8mb4'
# - '--collation-server=utf8mb4_unicode_ci'
# ports:
# - "3307:3306"
# volumes:
# - ./data:/var/lib/mysql
# networks:
# - aiary

backend:
container_name: backend
build:
context: backend-spring
context: ./backend-spring
dockerfile: Dockerfile
network_mode: "service:node1"
restart: always
# depends_on:
# - mysql
# ports:
# - "8080:8080"
environment:
# SPRING_DATASOURCE_URL: ${MYSQL_URL}
# SPRING_DATASOURCE_USERNAME: ${MYSQL_USER}
# SPRING_DATASOURCE_PASSWORD: ${MYSQL_PASSWORD}
SPRING_JPA_HIBERNATE_DDL_AUTO: update
networks:
- aiary

redis:
container_name: redis
image: redis:latest
ports:
- 6379:6379
node1:
container_name: node1
image: redis
volumes:
- ./redis/data:/data
labels:
- "name=redis"
- "mode=standalone"
restart: always
command: redis-server
- ./redis/redis1.conf:/usr/local/etc/redis/redis.conf
command: redis-server /usr/local/etc/redis/redis.conf
ports:
- 7001:7001
- 7002:7002
- 7003:7003
- 7004:7004
- 7005:7005
- 7006:7006
- 8080:8080
networks:
- aiary

node2:
network_mode: "service:node1"
container_name: node2
image: redis
volumes:
- ./redis/redis2.conf:/usr/local/etc/redis/redis.conf
command: redis-server /usr/local/etc/redis/redis.conf

node3:
network_mode: "service:node1"
container_name: node3
image: redis
volumes:
- ./redis/redis3.conf:/usr/local/etc/redis/redis.conf
command: redis-server /usr/local/etc/redis/redis.conf

node4:
network_mode: "service:node1"
container_name: node4
image: redis
volumes:
- ./redis/redis4.conf:/usr/local/etc/redis/redis.conf
command: redis-server /usr/local/etc/redis/redis.conf

node5:
network_mode: "service:node1"
container_name: node5
image: redis
volumes:
- ./redis/redis5.conf:/usr/local/etc/redis/redis.conf
command: redis-server /usr/local/etc/redis/redis.conf

node6:
network_mode: "service:node1"
container_name: node6
image: redis
volumes:
- ./redis/redis6.conf:/usr/local/etc/redis/redis.conf
command: redis-server /usr/local/etc/redis/redis.conf

redis-cluster-entry:
network_mode: "service:node1"
image: redis
container_name: redis-cluster
command: redis-cli --cluster create 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005 127.0.0.1:7006 --cluster-replicas 1 --cluster-yes
depends_on:
- node1
- node2
- node3
- node4
- node5
- node6

ai_backend:
container_name: ai_backend
build:
Expand All @@ -80,30 +110,12 @@ services:
FLASK_ENV: development
FLASK_DEBUG: 1
command: gunicorn -w 5 -b 0:8000 wsgi:app
ports:
- 8000:8000
restart: unless-stopped
networks:
- aiary

nginx:
container_name: nginx
build:
context: ./nginx
dockerfile: Dockerfile
ports:
- "80:80"
volumes:
- build_frontend:/var/www/frontend
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/log:/var/log/nginx
expose:
- "80"
depends_on:
- ai_backend
- backend
- frontend
networks:
- aiary
restart: on-failure

ai_rabbitmq:
hostname: rabbit
Expand Down

0 comments on commit 64b3871

Please sign in to comment.