Skip to content

Commit

Permalink
🚀 feat(boiler) : add docker image , compose , husky
Browse files Browse the repository at this point in the history
  • Loading branch information
ImNM committed Jul 11, 2022
1 parent 0589268 commit 4c0a3eb
Show file tree
Hide file tree
Showing 7 changed files with 881 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

lint-staged
18 changes: 16 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@

{
"arrowParens": "avoid",
"bracketSpacing": true,
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxBracketSameLine": false,
"jsxSingleQuote": false,
"printWidth": 80,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": true,
"singleQuote": true,
"trailingComma": "all"
}
"tabWidth": 2,
"trailingComma": "none",
"useTabs": false
}
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Step 1
## base image for Step 1: Node 14
FROM node:14 AS builder
WORKDIR /app
## 프로젝트의 모든 파일을 WORKDIR(/app)로 복사한다
COPY . .
## Nest.js project를 build 한다
RUN npm install
RUN npm run build


# Step 2
## base image for Step 2: Node 14-alpine(light weight)
FROM node:14-alpine
WORKDIR /app
## Step 1의 builder에서 build된 프로젝트를 가져온다
COPY --from=builder /app ./
## application 실행
CMD ["npm", "run", "start:prod"]
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '3.7'
services:
redis:
image: 'redis:alpine'
ports:
- '6379:6379'
postgres:
image: postgres:latest
container_name: postgres
restart: always
ports:
- '5432:5432'
environment:
POSTGRES_USER: 'gosrcok'
POSTGRES_PASSWORD: 'gosrock'
Loading

0 comments on commit 4c0a3eb

Please sign in to comment.