Replace nginx with caddy

This commit is contained in:
Maciej Pędzich 2024-07-26 17:23:02 +02:00
parent 9ba99adead
commit 24c2d336bb
Signed by: maciejpedzich
GPG Key ID: CE4A303D84882F0D
3 changed files with 16 additions and 18 deletions

13
Caddyfile Normal file
View File

@ -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
}

View File

@ -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;"]

View File

@ -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;
}
}