diff --git a/Dockerfile b/Dockerfile index 72c4e66..6b76f9e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20-alpine as build +FROM node:18-alpine as build ARG env_target ARG release_version @@ -13,13 +13,8 @@ RUN echo -e "\n" >> /app/.env RUN echo -e "APP_VERSION=${release_version}" >> /app/.env RUN npm install - RUN npm run build -FROM nginx:1.16.0-alpine - -COPY --from=build /app/dist /usr/share/nginx/html - -EXPOSE 80 - -CMD ["nginx", "-g", "daemon off;"] +FROM caddy:2.6.1-alpine +COPY caddy/Caddyfile /etc/caddy/Caddyfile +COPY --from=build /app/dist /srv \ No newline at end of file diff --git a/caddy/Caddyfile b/caddy/Caddyfile new file mode 100644 index 0000000..ded687f --- /dev/null +++ b/caddy/Caddyfile @@ -0,0 +1,5 @@ +:80 { + root * /srv + try_files {path} /index.html + file_server +} \ No newline at end of file diff --git a/nginx/nginx.conf b/nginx/nginx.conf deleted file mode 100644 index 84700b7..0000000 --- a/nginx/nginx.conf +++ /dev/null @@ -1,17 +0,0 @@ -server { - - listen 80; - - location / { - root /usr/share/nginx/html; - index index.html index.htm; - try_files $uri $uri/ /index.html; - } - - error_page 500 502 503 504 /50x.html; - - location = /50x.html { - root /usr/share/nginx/html; - } - -}