Skip to content
Open
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
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Alpine version for the runner contianer
ARG ALPINE_VERSION=latest

# golang builder image
FROM golang:1.21-bullseye AS builder
WORKDIR /build
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -buildvcs=false -pgo=auto -ldflags="-w -s -X 'main.Version=$(git describe --tags)'" -o app . \
&& git clone https://github.com/andybalholm/redwood-config.git /tmp/redwood-config

# Final runner image
FROM alpine:${ALPINE_VERSION} AS runner

# Copy in config & app binary
COPY --from=builder /build/app /app
COPY --from=builder /tmp/redwood-config /etc/redwood
RUN mkdir -p /var/log/redwood

# Expose the default ports from redwood-config
EXPOSE 6502 6510

# Run the app
ENTRYPOINT [ "/app" ]