Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added docker #127

Open
wants to merge 1 commit into
base: prod
Choose a base branch
from
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