From 09a1f3f87b93600d3da2c5f302b79cb27e4e9700 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 26 Dec 2023 21:28:17 +0000 Subject: [PATCH] Use nginx to serve built files (#808) Resolves #842 Better suited than python + handles sigterm better Co-authored-by: Harel M --- Dockerfile | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index bc9835ce0..a2f23b206 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,17 +6,11 @@ COPY package.json package-lock.json ./ RUN npm install # Build maputnik -# TODO: we should also do a npm run test here (needs more dependencies) COPY . . RUN npm run build #--------------------------------------------------------------------------- +# Create a clean nginx-alpine slim image with just the build results +FROM nginx:alpine-slim -# Create a clean python-based image with just the build results -FROM python:3-slim -WORKDIR /maputnik - -COPY --from=builder /maputnik/dist . - -EXPOSE 8888 -CMD python -m http.server 8888 +COPY --from=builder /maputnik/dist /usr/share/nginx/html/