Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*
!/cmd
!/internal
!go.*
!Makefile
40 changes: 24 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
from golang:1.24.2 as build
workdir /app
copy . .
run make

from ubuntu:noble-20250404 as base
copy --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
copy --from=build /app/bin/kamal-proxy /usr/local/bin/
expose 80 443

run useradd kamal-proxy
run mkdir -p /home/kamal-proxy/.config/kamal-proxy
run chown -R kamal-proxy:kamal-proxy /home/kamal-proxy
user kamal-proxy:kamal-proxy

cmd [ "kamal-proxy", "run" ]
FROM golang:1.24.2 AS build

WORKDIR /app

COPY go.mod go.sum ./
RUN go mod download

COPY . .
RUN make

FROM ubuntu:noble-20250404 AS base

COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=build /app/bin/kamal-proxy /usr/local/bin/

EXPOSE 80 443

RUN useradd kamal-proxy \
&& mkdir -p /home/kamal-proxy/.config/kamal-proxy \
&& chown -R kamal-proxy:kamal-proxy /home/kamal-proxy

USER kamal-proxy:kamal-proxy

CMD ["kamal-proxy", "run"]