Skip to content

Commit

Permalink
chor: minor Dockerfile improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
ddfreiling committed Aug 26, 2024
1 parent bb162ea commit 5ad18f8
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
###############
# Build image #
###############
FROM golang:1.22-bookworm as builder
FROM golang:1.22-bookworm AS builder

WORKDIR /lcp

Expand All @@ -14,8 +14,11 @@ RUN apt-get update && apt-get -y install build-essential && apt-get clean
# Needed for sqlite3 lib
ENV CGO_CFLAGS="-D_LARGEFILE64_SOURCE"
ENV CGO_ENABLED=1
ENV GOOS=linux
ENV GOARCH=amd64

# Must be defined as ARG first to use. Inspiration from https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/
ARG TARGETOS TARGETARCH
ENV GOOS=${TARGETOS}
ENV GOARCH=${TARGETARCH}

RUN go build -o $GOPATH/bin/ ./lcpserver
RUN go build -o $GOPATH/bin/ ./lsdserver
Expand All @@ -24,7 +27,7 @@ RUN go build -o $GOPATH/bin/ ./lcpencrypt
#######################
# Runtime image (LCP) #
#######################
FROM debian:bookworm-slim as runtime-lcp
FROM debian:bookworm-slim AS runtime-lcp
LABEL org.opencontainers.image.source https://github.com/notalib/readium-lcp-server
WORKDIR /app

Expand Down Expand Up @@ -59,7 +62,7 @@ CMD ["/app/lcpserver"]
#######################
# Runtime image (LSD) #
#######################
FROM runtime-lcp as runtime-lsd
FROM runtime-lcp AS runtime-lsd
LABEL org.opencontainers.image.source https://github.com/notalib/readium-lcp-server

# Mounted config.yaml decides which ports to use. This is the default from config.localhost.yml.
Expand Down

0 comments on commit 5ad18f8

Please sign in to comment.