Skip to content

Commit

Permalink
build: dev dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
scarf005 committed Oct 5, 2024
1 parent 8391055 commit 341e208
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# backend-nest

6차 개발팀은 nestjs 로 새로 작성하기로 했습니다

## 개발용 compose 실행 방법

```sh
$ docker compose -f compose-dev.yml up --remove-orphans
```
6 changes: 6 additions & 0 deletions backend/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM node:22-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable

WORKDIR /app
3 changes: 2 additions & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,6 @@
],
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
},
"packageManager": "[email protected]+sha512.4abf725084d7bcbafbd728bfc7bee61f2f791f977fd87542b3579dcb23504d170d46337945e4c66485cd12d588a0c0e570ed9c477e7ccdd8507cf05f3f92eaca"
}
27 changes: 27 additions & 0 deletions compose-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
services:
database:
platform: linux/x86_64
container_name: database
image: mysql:8.0
environment:
- TZ=Asia/Seoul

ports:
- 3306:3306

env_file: .env

backend:
container_name: backend
restart: on-failure
build:
context: backend
dockerfile: Dockerfile.dev

entrypoint: ["pnpm", "run", "start:dev"]
volumes:
- ./backend:/app
- ./backend/logs:/app/backend/logs
ports:
- 3000:3000
env_file: .env

0 comments on commit 341e208

Please sign in to comment.