ci: update try use caddy
continuous-integration/drone/tag Build is passing Details

main 1.0.0-production.3
Supan Adit Pratama 2024-10-04 04:18:08 +00:00
parent 45178d1312
commit c77059971c
3 changed files with 9 additions and 26 deletions

View File

@ -1,4 +1,4 @@
FROM node:20-alpine as build FROM node:18-alpine as build
ARG env_target ARG env_target
ARG release_version ARG release_version
@ -13,13 +13,8 @@ RUN echo -e "\n" >> /app/.env
RUN echo -e "APP_VERSION=${release_version}" >> /app/.env RUN echo -e "APP_VERSION=${release_version}" >> /app/.env
RUN npm install RUN npm install
RUN npm run build RUN npm run build
FROM nginx:1.16.0-alpine FROM caddy:2.6.1-alpine
COPY caddy/Caddyfile /etc/caddy/Caddyfile
COPY --from=build /app/dist /usr/share/nginx/html COPY --from=build /app/dist /srv
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

5
caddy/Caddyfile Normal file
View File

@ -0,0 +1,5 @@
:80 {
root * /srv
try_files {path} /index.html
file_server
}

View File

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