Compare commits

1 Commits

Author SHA1 Message Date
3ea83b66f7 feat: Staging branch
All checks were successful
ordr deploy / build (push) Successful in -47s
2025-11-22 12:52:19 -07:00
3 changed files with 12 additions and 16 deletions

View File

@@ -3,7 +3,7 @@ run-name: ${{ gitea.actor }} is deploying ordr
on:
push:
branches:
- main
- staging
jobs:
build:

View File

@@ -1,34 +1,31 @@
# Stage 1: Build the application
FROM golang:1.25.3-alpine AS base
FROM golang:1.25.3-alpine AS builder
FROM base AS builder
COPY . /app
WORKDIR /app
# Copy go.mod and go.sum first to leverage Docker's caching
ENV GOPROXY=direct
RUN apk add git
COPY go.mod go.sum ./
RUN go mod download
# Copy the rest of the application source code
COPY . .
# Build the Go application
# CGO_ENABLED=0 disables Cgo for a fully static binary
# -a links all packages statically
# -installsuffix cgo_non_shared avoids issues with shared libraries
RUN CGO_ENABLED=0 GOOS=linux go build
RUN ls -al
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo_non_shared -o main .
# Stage 2: Create the final lean image
FROM base
FROM alpine:latest
WORKDIR /root/
# Copy the built binary from the builder stage
COPY --from=builder /app/ordr-api .
COPY --from=builder /app/.env .
COPY --from=builder /app/main .
# Expose the port your Gin application listens on (e.g., 8080)
EXPOSE 8080
# Command to run the application
ENV GIN_MODE=release
CMD ["./ordr-api"]
CMD ["./ordr-api"]

View File

@@ -59,8 +59,7 @@ func main() {
authenticator, auth_err := auth.New()
if auth_err != nil {
log.Printf("ERROR: Failed to initialize Authenticator %s", auth_err.Error())
log.Fatal("ERROR: Failed to initialize authenticator...")
log.Fatal("ERROR: Failed to initialize Authenticator")
return
}