This repository has no description
1ARG TAG=dev
2
3# Stage 1: Build the Go binary using Just
4FROM golang:1.23.4-alpine3.20 AS builder
5
6# Install Just in the builder stage
7RUN apk add --no-cache curl bash git
8RUN curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /app
9
10ENV PATH="/app:${PATH}"
11
12# Set the working directory in the container
13WORKDIR /app
14
15# Copy the go.mod and go.sum files first to cache the dependencies
16COPY go.mod go.sum ./
17
18# Download dependencies
19RUN go mod download
20
21# Copy the Justfile and source code
22COPY Justfile .
23COPY . .
24
25# Build the Go binary using Just
26RUN /app/just build notella ${TAG}
27
28# Stage 2: Create a lightweight image with just the binary
29FROM alpine:3.21 AS runner
30
31# Set the working directory in the container
32WORKDIR /app
33
34# Copy the binary from the builder stage
35COPY --from=builder /app/notella /app/notella
36
37# Command to run the binary
38CMD ["/app/notella"]
39