반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- submit
- node.js
- git
- Maven
- spring3
- MSsql
- pwa
- rocky9
- ajax
- config
- docker
- FCM
- SpringBoot
- Push
- Next.js
- MariaDB
- centos7
- yona
- nodejs
- Java
- security
- jquery
- jenkins
- javascript
- mybatis
- PM2
- Eclipse
- NextJS
- mysql
- popup
Archives
- Today
- Total
ふたりで
docker-desktop + mongodb compose 본문
728x90
반응형
SMALL
docker에 mongodb만 컨테이너로 실행시 참고.
# C:\docker-test\docker-workJob\mongodb-container> docker-compose.yml
version: '3.8'
services:
db_mongodb:
image: "mongo:latest"
container_name: db_mongodb_receipt
ports:
- "27017:27017" # 필요에 따라 주석 처리
environment:
MONGO_INITDB_ROOT_USERNAME: "root"
MONGO_INITDB_ROOT_PASSWORD: "12345" # 추후.env 파일에서 불러오기
volumes:
- mongodb_data_receipt:/data/db
healthcheck:
test: [ "CMD", "mongo", "--eval", "db.adminCommand('ping')" ]
interval: 30s
timeout: 10s
retries: 3
volumes:
mongodb_data_receipt:
반응형
728x90
SMALL
# yml 파일 실행 및 docker 명령어.
PS C:\docker-test\docker-workJob\mongodb-container> docker-compose up -d
time="2025-01-06T13:58:46+09:00" level=warning msg="C:\\docker-test\\docker-workJob\\mongodb-container\\docker-compose.yml: `version` is obsolete"
[+] Running 9/9
✔ db_mongodb Pulled 35.7s
✔ de44b265507a Pull complete 6.5s
✔ add2cfa32b4d Pull complete 6.6s
✔ 0d3422d31c84 Pull complete 7.0s
✔ e9869afb5187 Pull complete 7.1s
✔ 9284108c06f8 Pull complete 7.2s
✔ 17351a831ef1 Pull complete 7.3s
✔ 2613644e011d Pull complete 31.8s
✔ 05cc0f1cded4 Pull complete 31.8s
[+] Running 3/3
✔ Network mongodb-container_default Created 0.1s
✔ Volume "mongodb-container_mongodb_data_receipt" Created 0.0s
✔ Container db_mongodb_receipt Started 10.0s
PS C:\docker-test\docker-workJob\mongodb-container>
728x90
반응형
LIST
'docker' 카테고리의 다른 글
docker+mongodb+mongodump+mongorestore (0) | 2025.01.07 |
---|---|
Create docker image and container by Dockerfile exampl (rock9(linux)+jdk8+tomcat8.5+spring3-web) (2) | 2024.07.30 |
Dockerfile build by Node.js Simple Project (0) | 2024.07.24 |
centos7+docker+MSSQL setup & config Ing~ (0) | 2022.09.08 |
centos7+docker+linux+mariadb setup&config (4) | 2022.08.25 |
Comments