Skip to content

Commit

Permalink
Merge pull request #236 from boostcampwm-2022/feat/docker
Browse files Browse the repository at this point in the history
  • Loading branch information
pushedrumex authored Dec 13, 2022
2 parents 9b29307 + c0b58c5 commit 63e1ca3
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 2 deletions.
45 changes: 45 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "client build",
"command": "npm",
"args": ["start"],
"options": {
"cwd": "${workspaceFolder}/client"
},
"presentation": { "group": "runwithme" }
},
{
"label": "api-server build",
"command": "npm",
"args": ["run", "start:dev"],
"options": {
"cwd": "${workspaceFolder}/server"
},
"presentation": { "group": "runwithme" }
},
{
"label": "noti-server build",
"command": "npm",
"args": ["run", "start:dev"],
"options": {
"cwd": "${workspaceFolder}/noti-server"
},
"presentation": { "group": "runwithme" }
},
{
"label": "chat-server build",
"command": "npm",
"args": ["run", "start:dev"],
"options": {
"cwd": "${workspaceFolder}/chat-server"
},
"presentation": { "group": "runwithme" }
},
{
"label": "Total build",
"dependsOn": ["api-server build", "noti-server build", "chat-server build"]
}
]
}
5 changes: 4 additions & 1 deletion chat-server/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@ lerna-debug.log*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/extensions.json

# mongodb data
/data
11 changes: 11 additions & 0 deletions chat-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM node:latest

WORKDIR /usr/src/app

COPY package*.json ./

RUN npm install --silent

COPY . .

EXPOSE 27017
31 changes: 31 additions & 0 deletions chat-server/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
services:
chat-server:
build:
context: .
dockerfile: Dockerfile
container_name: chat-server
ports:
- '8080:8080'
command: npm run start
networks:
- webnet
depends_on:
- mongodb_chat
environment:
- MONGO_URL=mongodb://mongodb_chat:27017/chat

mongodb_chat:
container_name: mongodb_chat
command: mongod --quiet --logpath /dev/null
image: mongo
volumes:
- ./data:/data/db
networks:
- webnet
logging:
driver: 'none'

networks:
webnet:
volumes:
chat-server:
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ services:
depends_on:
- redis

environment:
- REDIS_HOST=redis
- REDIS_PORT=6379

redis:
container_name: redis
image: redis:5
Expand Down
5 changes: 4 additions & 1 deletion noti-server/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ services:
- webnet
depends_on:
- noti-redis
environment:
- REDIS_HOST=noti-redis
- REDIS=6000

noti-redis:
container_name: noti-redis
image: redis:5
command: redis-server
ports:
- '6379:6379'
- '6000:6000'
networks:
- webnet

Expand Down
3 changes: 3 additions & 0 deletions server/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ services:
depends_on:
- mysqldb
- redis
environment:
- REDIS_HOST=redis
- REDIS_PORT=6379

redis:
container_name: redis
Expand Down

0 comments on commit 63e1ca3

Please sign in to comment.