Skip to content

Commit

Permalink
build: docker-compose.yaml 파일 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
kimsudang committed Dec 21, 2024
1 parent de4e21b commit a5efbca
Show file tree
Hide file tree
Showing 3 changed files with 9,347 additions and 4,932 deletions.
76 changes: 76 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
services:
app:
image: kimsudang/nestjs-app:latest
ports:
- '8080:8080'
command: ['npm', 'run', 'start']
environment:
PORT: 8080
MONGO_URI: mongodb://mongo:27017/myapp_db
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
mongo:
condition: service_healthy

mysql:
image: mysql:8.0
container_name: mysql
volumes:
- mysql-data:/var/lib/mysql
environment:
MYSQL_DATABASE: myapp_db
MYSQL_USER: myapp_user
MYSQL_PASSWORD: strongpassword
MYSQL_ROOT_PASSWORD: rootpassword
LC_ALL: C.UTF-8
ports:
- '3306:3306'
healthcheck:
test: ['CMD', 'mysqladmin', 'ping', '-h', 'localhost']
interval: 10s
timeout: 5s
retries: 5

redis:
image: redis:latest
container_name: redis
ports:
- '6379:6379'
command: redis-server --requirepass strongpassword --port 6379 --appendonly yes
labels:
- 'name=redis'
- 'mode=standalone'
volumes:
- redis-data:/data
restart: always
healthcheck:
test: ['CMD', 'redis-cli', '-a', 'strongpassword', 'ping']
interval: 10s
timeout: 5s
retries: 5

mongo:
image: mongo:latest
container_name: mongo
ports:
- '27017:27017'
environment:
MONGO_INITDB_DATABASE: myapp_db
MONGO_INITDB_ROOT_USERNAME: myapp_user
MONGO_INITDB_ROOT_PASSWORD: strongpassword
volumes:
- mongo-data:/data/db
restart: always
healthcheck:
test: ['CMD', 'mongo', '--eval', "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5

volumes:
mysql-data:
redis-data:
mongo-data:
Loading

0 comments on commit a5efbca

Please sign in to comment.