Skip to content

Commit 95f4d1c

Browse files
committed
Add Dockerfile and Compose file for development
1 parent b6ef5fa commit 95f4d1c

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM node:lts-slim AS base
2+
WORKDIR /usr/local/app
3+
4+
COPY package*.json ./
5+
RUN npm install
6+
COPY ./src ./src
7+
8+
FROM base AS dev
9+
CMD ["npm", "run", "dev"]
10+
11+
FROM base AS prod
12+
USER node
13+
EXPOSE 3000
14+
CMD ["node", "src/index.js"]

compose.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
services:
2+
app:
3+
build:
4+
context: .
5+
target: dev
6+
ports:
7+
- 3000:3000
8+
develop:
9+
watch:
10+
- path: ./src
11+
action: sync
12+
target: /usr/local/app/src
13+
- path: ./package-lock.json
14+
action: rebuild

0 commit comments

Comments
 (0)