From 12cb58b891c66b18bd40b1d82ff109733ebcc741 Mon Sep 17 00:00:00 2001 From: Max Schmidt Date: Tue, 24 Oct 2023 09:38:55 +0200 Subject: [PATCH] test Signed-off-by: Max Schmidt --- astro/Dockerfile | 7 ++----- astro/nginx.conf | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 astro/nginx.conf diff --git a/astro/Dockerfile b/astro/Dockerfile index a9f8467..a93aaed 100644 --- a/astro/Dockerfile +++ b/astro/Dockerfile @@ -16,9 +16,6 @@ COPY --from=base /base . ADD "https://random-uuid.deno.dev" skipcache RUN yarn build -FROM denoland/deno:1.36.1 AS prod -WORKDIR /site -RUN deno install --allow-net --allow-read https://deno.land/std@0.198.0/http/file_server.ts -COPY --from=build /build/dist . -CMD ["file_server", "--port", "3000", "--no-dir-listing"] +FROM nginx:stable AS prod +COPY --from=build /build/dist /usr/share/nginx/html EXPOSE 3000 \ No newline at end of file diff --git a/astro/nginx.conf b/astro/nginx.conf new file mode 100644 index 0000000..56f005e --- /dev/null +++ b/astro/nginx.conf @@ -0,0 +1,19 @@ +http { + gzip on; + gzip_vary on; + gzip_proxied any; + gzip_comp_level 6; + gzip_buffers 16 8k; + gzip_http_version 1.1; + gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; + server { + listen 3000; + location ~* \.(jpg|jpeg|png|gif|ico|css|js|htm|html)$ { + expires 30d; # set long caching period on static files + add_header Pragma public; + add_header Cache-Control "public"; + try_files $uri $uri/ =404; # serve file if it exists, otherwise 404 + } + + } +}