Files
junk2jive-server/Dockerfile
rogueking 02da82fea1
Some checks failed
golangci-lint / lint (push) Failing after 20s
Run Go Tests / build (push) Failing after 0s
build / Build (push) Failing after 14s
Build and Push Docker Image / Build and push image (push) Successful in 2m8s
workflow and docker fixes
2025-05-06 15:54:35 -07:00

41 lines
863 B
Docker

# Build stage
FROM golang:1.24-alpine AS builder
# # Install git and build dependencies
# RUN apk add --no-cache git make build-base
# Set working directory
WORKDIR /app
# Copy go mod and sum files
COPY go.mod go.sum ./
RUN go mod download
# Copy the source code
COPY . .
# Build the application
RUN CGO_ENABLED=0 GOOS=linux go build -o junk2jive-server ./cmd/junk2jive
# Release stage
FROM alpine:latest
# Add CA certificates and timezone data
RUN apk --no-cache add ca-certificates tzdata
WORKDIR /app
# Copy the binary from builder
COPY --from=builder /app/junk2jive-server /app/
# Copy configuration if needed
COPY data/config.yaml /app/data/
# Create a non-root user to run our application
RUN adduser -D -g '' appuser
USER appuser
# Expose the port the app runs on
EXPOSE 8080
# Command to run the executable
ENTRYPOINT ["/app/junk2jive-server"]