Skip to content

Instantly share code, notes, and snippets.

@fullpipe
Created February 5, 2023 22:29
Show Gist options
  • Save fullpipe/068b38587b495c55fc4b28a703132b72 to your computer and use it in GitHub Desktop.
Save fullpipe/068b38587b495c55fc4b28a703132b72 to your computer and use it in GitHub Desktop.
Angular app with Caddy server and Docker for k8s
{
auto_https off
http_port 8080
admin off
}
:8080 {
root * /app
encode zstd gzip
file_server
try_files {path} /index.html?{query}
}
# syntax = docker.io/docker/dockerfile:experimental
# Use official node image as the base image
FROM node:lts-slim as build
# Set the working directory
WORKDIR /app
# Add the source code to app
COPY package* .
# Install all the dependencies
RUN npm ci
# Copy rest of the stuff
COPY . .
# Generate the build of the application
RUN npm run build:prod
FROM caddy:alpine as release
EXPOSE 8080
COPY Caddyfile /etc/caddy/Caddyfile
COPY --from=build /app/dist/YOUBULDPATH /app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment