diff --git a/Caddyfile b/Caddyfile new file mode 100644 index 0000000..79f251e --- /dev/null +++ b/Caddyfile @@ -0,0 +1,13 @@ +{ + auto_https off + servers { + trusted_proxies static private_ranges + } +} + +http://racemash.maciejpedzi.ch { + root * /srv + encode gzip + try_files {path} /index.html + file_server +} diff --git a/Dockerfile b/Dockerfile index 0b018ef..16cfbd3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,8 +4,7 @@ COPY . . RUN npm i RUN npm run build -FROM nginx:stable-alpine AS runtime -COPY --from=build /app/nginx/default.conf /etc/nginx/conf.d/default.conf -COPY --from=build /app/dist /usr/share/nginx/html +FROM caddy:2.8 AS runtime +COPY --from=build /app/Caddyfile /etc/caddy/Caddyfile +COPY --from=build /app/dist /srv EXPOSE 80 -CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx/default.conf b/nginx/default.conf deleted file mode 100644 index 061151e..0000000 --- a/nginx/default.conf +++ /dev/null @@ -1,14 +0,0 @@ -server { - listen 80; - server_name racemash.maciejpedzi.ch; - root /usr/share/nginx/html; - index index.html index.htm; - - location /images { - root /usr/share/nginx/html; - } - - location / { - try_files $uri $uri/ /index.html; - } -}