-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerfile
More file actions
34 lines (24 loc) · 871 Bytes
/
Containerfile
File metadata and controls
34 lines (24 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#------------------------------------------------------------------
FROM golang:1.23-alpine AS builder
# Update alpine.
RUN apk update && apk upgrade
# Install alpine dependencies.
RUN apk --no-cache --update add build-base bash
# Create and change to the 'service' directory.
WORKDIR /service
# Install project dependencies.
COPY go.mod go.sum ./
RUN go mod download
# Copy and build code.
COPY . .
RUN make build
#-------------------------------------------------------------------
FROM alpine:3
# Create and change to the the 'service' directory.
WORKDIR /service
# Copy the files to the production image from the builder stage.
COPY --from=builder /service/bin /service/
COPY --from=builder /service/db /service/db/
# Run the web service on container startup.
CMD ["/service/authorizer"]
#-------------------------------------------------------------------