Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions srcs/.env
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 근데 env가 왜 올라와있지?

Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,18 @@ DATABASE_USER_URL=postgres://${DB_USER_USER}:${DB_USER_PASSWORD}@database_user:$
REDIS_EVENTS_URL=redis://redis_events:6379
REDIS_WEBSOCKETS_URL=redis://redis_websockets:6379


# Service URLs for Docker environment
USER_SERVICE_URL=http://user:8000/api/user/
CHAT_SERVICE_URL=http://chat:8000/api/chat/
GAME_SERVICE_URL=http://game:8000/api/game/

# Database settings for production
DATABASE_ENGINE=postgresql

# Redis settings for production
REDIS_HOST=redis_websockets
REDIS_PORT=6379
REDIS_DB=0
REDIS_CAPACITY=500
DATA_PATH=/Users/yeolee2/supershy/data
2 changes: 1 addition & 1 deletion srcs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dir:
@bash ./init_project.sh

clean: down
# @docker system prune --all --force
@docker system prune --all --force

fclean: clean
@docker system prune --all --force --volumes
Expand Down
20 changes: 16 additions & 4 deletions srcs/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ services:
context: ./api_gateway
ports:
- "80:80"
- "443:443"
env_file:
- ./.env
depends_on:
Expand Down Expand Up @@ -34,6 +35,8 @@ services:
env_file:
- ./.env
- ./user/.env
environment:
- DATABASE_ENGINE=postgresql
depends_on:
- database_user
networks:
Expand All @@ -47,6 +50,8 @@ services:
env_file:
- ./.env
- ./chat/.env
environment:
- DATABASE_ENGINE=postgresql
depends_on:
- database_chat
networks:
Expand All @@ -60,8 +65,10 @@ services:
env_file:
- ./.env
- ./game/.env
environment:
- DATABASE_ENGINE=postgresql
depends_on:
- database_game
- database_game
networks:
- backend

Expand All @@ -75,6 +82,11 @@ services:
env_file:
- ./.env
- ./frontend/.env
environment:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

env 파일에 안하고 명시적으로 한 이유가 있을까요?

- USER_API_URL=http://localhost/api/user
- CHAT_API_URL=http://localhost/api/chat
- FRIEND_API_URL=http://localhost/api/user/friend
- GAME_API_URL=http://localhost/api/game

database_user:
container_name: database_user
Expand All @@ -85,7 +97,7 @@ services:
- ./.env
- ./user/.env
volumes:
- db_user_data:/var/lib/postgresql/data
- db_user_data:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -h database_user -p ${POSTGRES_PORT} -U ${DB_USER_USER}"]
interval: 5s
Expand All @@ -103,7 +115,7 @@ services:
- ./.env
- ./chat/.env
volumes:
- db_chat_data:/var/lib/postgresql/data
- db_chat_data:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -h database_chat -p ${POSTGRES_PORT} -U ${DB_CHAT_USER}"]
interval: 5s
Expand All @@ -121,7 +133,7 @@ services:
- ./.env
- ./game/.env
volumes:
- db_game_data:/var/lib/postgresql/data
- db_game_data:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -h database_game -p ${POSTGRES_PORT} -U ${DB_GAME_USER}"]
interval: 5s
Expand Down