Skip to content

Commit 187d1da

Browse files
committed
added docker
1 parent 31e383e commit 187d1da

2 files changed

Lines changed: 49 additions & 0 deletions

File tree

Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
# minimal alpine image for quick dev build
3+
# FROM mhart/alpine-node
4+
5+
6+
FROM node:alpine
7+
WORKDIR /app
8+
COPY . .
9+
RUN yarn install
10+
RUN yarn build
11+
EXPOSE 3000
12+
CMD ["yarn", "start"]
13+
14+
15+
16+
#For production environment
17+
# FROM node:alpine as BUILD_IMAGE
18+
# WORKDIR /app
19+
# COPY package.json yarn.lock ./
20+
# # install dependencies
21+
# RUN yarn install --frozen-lockfile
22+
# COPY . .
23+
# # build
24+
# RUN yarn build
25+
# # remove dev dependencies
26+
# RUN npm prune --production
27+
28+
# FROM node:alpine
29+
# WORKDIR /app
30+
# # copy from build image
31+
# COPY --from=BUILD_IMAGE /app/package.json ./package.json
32+
# COPY --from=BUILD_IMAGE /app/node_modules ./node_modules
33+
# COPY --from=BUILD_IMAGE /app/.next ./.next
34+
# COPY --from=BUILD_IMAGE /app/public ./public
35+
# EXPOSE 3000
36+
# CMD ["yarn", "start"]

docker-compose.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: '3.8'
2+
services:
3+
web:
4+
build:
5+
context: ./
6+
7+
volumes:
8+
- .:/app
9+
command: npm run dev
10+
ports:
11+
- "3000:3000"
12+
environment:
13+
NODE_ENV: development

0 commit comments

Comments
 (0)