Skip to content

Commit

Permalink
♻️ Migrate from NGINX to Caddy
Browse files Browse the repository at this point in the history
  • Loading branch information
agmangas committed Sep 19, 2024
1 parent 836d92d commit 63ced69
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 73 deletions.
26 changes: 26 additions & 0 deletions moderate_ui/Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
:80 {
handle /api/* {
uri strip_prefix /api
reverse_proxy {$MODERATE_API_URL}
}

# Notebooks are a special case to allow for embedding in iframes
handle /notebook/* {
reverse_proxy {$MODERATE_API_URL}
}

handle {
root * /usr/share/caddy
try_files {path} /index.html
file_server
}

log {
output stdout
level INFO
}

request_body {
max_size 0
}
}
7 changes: 3 additions & 4 deletions moderate_ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ COPY --from=deps /app/refine/node_modules ./node_modules
COPY . .
RUN npm run build

FROM nginx:1 AS runner
FROM caddy:2 AS runner
ENV MODERATE_API_URL=https://api.gw.moderate.cloud
RUN rm /etc/nginx/conf.d/default.conf
COPY ./nginx.conf.template /etc/nginx/templates/nginx.conf.template
COPY --from=builder /app/refine/dist /usr/share/nginx/html
COPY Caddyfile /etc/caddy/Caddyfile
COPY --from=builder /app/refine/dist /usr/share/caddy
69 changes: 0 additions & 69 deletions moderate_ui/nginx.conf.template

This file was deleted.

0 comments on commit 63ced69

Please sign in to comment.