-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (28 loc) · 791 Bytes
/
Dockerfile
File metadata and controls
39 lines (28 loc) · 791 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
35
36
37
38
39
FROM golang:1.13-alpine3.11 as builder1
# Setting up environment for builder1
ENV GO111MODULE=on
WORKDIR /app/reverseproxy
# install required package(s)
RUN apk --no-cache add ca-certificates git
# Copy dependency list
COPY go.mod .
COPY go.sum .
RUN go mod download
# Copy files
COPY ./*.go ./
COPY ./proxy/*.go ./proxy/
COPY ./models/ ./models
# Compile
RUN go build -o main
# Create new stage based on alpine
FROM alpine:latest
#Copy ca certs
COPY --from=builder1 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
# Copy compiled binary from builder1
WORKDIR /app
RUN mkdir /app/config/
COPY --from=builder1 /app/reverseproxy/main .
# Set Debuglevel and start the server
ENV PROXY_CONFIG "/app/config/config.toml"
ENV PROXY_DEBUG "true"
CMD [ "/app/main" ]