diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..609d450 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +/.github +/Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ad5c03f --- /dev/null +++ b/Dockerfile @@ -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"]