aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
authorJan Tuomi <jans.tuomi@gmail.com>2022-02-06 10:52:23 +0200
committerJan Tuomi <jans.tuomi@gmail.com>2022-02-06 10:52:23 +0200
commitc54bf575a8b75f4c1145c8284ad4a10909091b6d (patch)
tree8661260e2d3cd39c74944d98350ff41663e74d9b /Dockerfile
parentf7271130ceebe1fd2d184298fc2d1e892ab7d64f (diff)
Dockerize for prod
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile15
1 files changed, 15 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..5e53b29
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,15 @@
+FROM node:16-alpine AS build
+
+WORKDIR /app
+COPY package-lock.json package.json ./
+RUN npm ci --only-prod
+COPY vite.config.ts tsconfig.json index.html .env.production ./
+COPY src ./src
+RUN npm run build
+
+FROM nginx:alpine AS serve
+
+RUN apk add --no-cache bash
+COPY --from=build /app/dist /usr/share/nginx/html
+COPY prod_bootstrap.sh /
+CMD ["bash", "/prod_bootstrap.sh", "/usr/share/nginx/html"]