summaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile21
1 files changed, 15 insertions, 6 deletions
diff --git a/Dockerfile b/Dockerfile
index 89746d6..89218ae 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,15 +1,24 @@
-FROM nginx:alpine as adelie
+FROM node:22-alpine AS builder
-COPY static/ /usr/share/nginx/html/
+ARG HOST="adelie.liz.coffee"
+ENV HOST=${HOST}
-COPY nginx.conf /etc/nginx/nginx.conf
+WORKDIR /app
+COPY package*.json ./
+RUN npm ci --only=production
+
+COPY src/ ./src/
+COPY esbuild.config.js ./
+RUN npm run build
-COPY docker-entrypoint.sh /usr/local/bin/
-RUN chmod +x /usr/local/bin/docker-entrypoint.sh
+FROM nginx:alpine as adelie
+
+COPY --from=builder /app/dist/ /usr/share/nginx/html/
+COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --quiet --tries=1 --spider http://localhost/ || exit 1
-ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
+CMD ["nginx", "-g", "daemon off;"]