Skip to content
Merged
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
27 changes: 18 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
# Start from a Debian image with the latest version of Go installed
# and a workspace (GOPATH) configured at /go.
FROM golang:1.26.1
# Build stage: the Go toolchain is only needed to compile. cgo is on
# (the SQLite driver, mattn/go-sqlite3, needs it), so the runtime base
# below must be the same Debian release, for a matching glibc.
FROM golang:1.26.1-trixie AS build

# Copy the local package files to the container's workspace.
ADD . /go/src/github.com/compscidr/goblog/

# Build the outyet command inside the container.
# (You may fetch or manage dependencies here,
# either manually or with a tool like "godep".)
ARG VERSION
RUN cd /go/src/github.com/compscidr/goblog/ && go build -ldflags="-X 'main.Version=$VERSION'" -v .

# Run the outyet command by default when the container starts.
# So `docker exec <container> ./goblog reset-admin-password` finds .env.
FROM debian:trixie-slim

# ca-certificates: outgoing HTTPS (OAuth, the plugin directory, SMTP over TLS).
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/*

# Same path as before, so existing bind mounts still line up, and
# `docker exec <container> ./goblog reset-admin-password` finds .env.
WORKDIR /go/src/github.com/compscidr/goblog

# The binary plus what it reads from the working directory at runtime.
COPY --from=build /go/src/github.com/compscidr/goblog/goblog ./
COPY www ./www
COPY themes ./themes
COPY templates ./templates

ENTRYPOINT cd /go/src/github.com/compscidr/goblog && ./goblog

# Document that the service listens on port 7000.
Expand Down
Loading