Skip to content

Instantly share code, notes, and snippets.

@stephenhillier
Created April 15, 2020 17:12
Show Gist options
  • Save stephenhillier/e22c265ba5c4ccd780d9179aac41dc0c to your computer and use it in GitHub Desktop.
Save stephenhillier/e22c265ba5c4ccd780d9179aac41dc0c to your computer and use it in GitHub Desktop.
Caddy 2 config
:8080
root * /app/src
encode gzip
route {
reverse_proxy /api/* {$WALLY_BACKEND_SERVICE}:8000
reverse_proxy /docs {$WALLY_BACKEND_SERVICE}:8000
file_server
try_files {path} /index.html
}
FROM node:10 as build
WORKDIR /app
COPY package*.json /app/
RUN npm ci
COPY . .
RUN npm run build
FROM caddy:2.0.0-beta.17
WORKDIR /app/src
COPY --from=build /app/dist/ /app/src
COPY --from=build /app/Caddyfile /etc/caddy/Caddyfile
EXPOSE 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment