diff --git a/Caddyfile.back b/Caddyfile.back deleted file mode 100644 index 2f346c4..0000000 --- a/Caddyfile.back +++ /dev/null @@ -1,16 +0,0 @@ -{ - auto_https off -} - -:8080 { - root * /usr/share/caddy - file_server - encode gzip zstd - handle_errors { - @404 { - expression {http.error.status_code} == 404 - } - rewrite @404 /404.html - file_server - } -} diff --git a/Dockerfile b/Dockerfile index e6b80a1..5f3cf7f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,10 +6,10 @@ WORKDIR /src RUN npm install \ && npm run build -FROM caddy:2.4.6-alpine +FROM nginx:1.21.5-alpine LABEL maintainer="marco.blessing@googlemail.com" -COPY --from=builder /src/Caddyfile /etc/caddy/Caddyfile -COPY --from=builder src/public /usr/share/caddy/ HEALTHCHECK --interval=15s --timeout=3s \ - CMD wget --no-verbose --tries=1 --spider http://localhost:8080/ || exit 1 -#RUN ls -la /usr/share/caddy/ + CMD wget --no-verbose --tries=1 --spider http://localhost:80/ || exit 1 +COPY --from=builder src/public /usr/share/nignx/html/ +COPY nginx.conf /etc/nginx/nginx.conf + diff --git a/Dockerfile.Caddy b/Dockerfile.Caddy new file mode 100644 index 0000000..e6b80a1 --- /dev/null +++ b/Dockerfile.Caddy @@ -0,0 +1,15 @@ +FROM node:lts-buster-slim as builder +COPY . /src +#RUN ls -la +WORKDIR /src +#RUN ls -a +RUN npm install \ + && npm run build + +FROM caddy:2.4.6-alpine +LABEL maintainer="marco.blessing@googlemail.com" +COPY --from=builder /src/Caddyfile /etc/caddy/Caddyfile +COPY --from=builder src/public /usr/share/caddy/ +HEALTHCHECK --interval=15s --timeout=3s \ + CMD wget --no-verbose --tries=1 --spider http://localhost:8080/ || exit 1 +#RUN ls -la /usr/share/caddy/ diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..bf1e9bd --- /dev/null +++ b/nginx.conf @@ -0,0 +1,17 @@ +events { + worker_connections 1024; +} +http { + include mime.types; + + server { + listen 80; + root /usr/share/nignx/html; + index index.html; + error_page 404 /404.html; + + location / { + try_files $uri $uri/ =404; + } + } +}