Created
February 5, 2023 22:29
-
-
Save fullpipe/068b38587b495c55fc4b28a703132b72 to your computer and use it in GitHub Desktop.
Angular app with Caddy server and Docker for k8s
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
auto_https off | |
http_port 8080 | |
admin off | |
} | |
:8080 { | |
root * /app | |
encode zstd gzip | |
file_server | |
try_files {path} /index.html?{query} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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