codex/dockerfile
2025-02-08 12:01:33 +01:00

25 lines
No EOL
521 B
Text

# use a minimal base image
FROM golang:1.23 AS builder
# set the working directory in the container
WORKDIR /app
# copy the go project files
COPY . .
# build the go server
RUN go mod tidy && go build -o codex-server
# create a smaller final image
FROM alpine:latest
WORKDIR /root/
# copy the built binary from the builder stage
COPY --from=builder /app/codex-server .
# expose the port (match your go server's listening port)
EXPOSE 61594
# run the go server
CMD ["./codex-server"]