Skip to content

Commit

Permalink
Add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
ayaka14732 committed Mar 26, 2023
1 parent 0302c53 commit d265985
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.github
/Dockerfile
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM node:alpine

RUN addgroup -S appgroup && \
adduser -S appuser -G appgroup && \
mkdir -p /home/appuser/app && \
chown appuser:appgroup /home/appuser/app
USER appuser

RUN yarn config set prefix ~/.yarn && \
yarn global add serve

WORKDIR /home/appuser/app
COPY --chown=appuser:appgroup package.json yarn.lock ./
RUN yarn install --frozen-lockfile
COPY --chown=appuser:appgroup . .

RUN yarn build
EXPOSE 3000

CMD ["/home/appuser/.yarn/bin/serve", "-s", "dist", "-l", "3000"]

0 comments on commit d265985

Please sign in to comment.