Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

# minimal alpine image for quick dev build
# FROM mhart/alpine-node


FROM node:alpine
WORKDIR /app
COPY . .
RUN yarn install
RUN yarn build
EXPOSE 3000
CMD ["yarn", "start"]



#For production environment
# FROM node:alpine as BUILD_IMAGE
# WORKDIR /app
# COPY package.json yarn.lock ./
# # install dependencies
# RUN yarn install --frozen-lockfile
# COPY . .
# # build
# RUN yarn build
# # remove dev dependencies
# RUN npm prune --production

# FROM node:alpine
# WORKDIR /app
# # copy from build image
# COPY --from=BUILD_IMAGE /app/package.json ./package.json
# COPY --from=BUILD_IMAGE /app/node_modules ./node_modules
# COPY --from=BUILD_IMAGE /app/.next ./.next
# COPY --from=BUILD_IMAGE /app/public ./public
# EXPOSE 3000
# CMD ["yarn", "start"]
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '3.8'
services:
web:
build:
context: ./

volumes:
- .:/app
command: npm run dev
ports:
- "3000:3000"
environment:
NODE_ENV: development