From d265985dfa8063e12f05eb51b852c82cf155375d Mon Sep 17 00:00:00 2001 From: Ayaka Mikazuki Date: Sun, 26 Mar 2023 23:29:49 +1000 Subject: [PATCH] Add Dockerfile --- .dockerignore | 2 ++ Dockerfile | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile 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"]