Commit 87557bd
Eric Bower
·
2023-06-19 09:29:27 -0400 EDT
parent befe10e
multistage build docker
1 files changed,
+8,
-2
+8,
-2
1@@ -1,3 +1,9 @@
2-FROM nginx
3-COPY ./public /usr/share/nginx/html
4+FROM golang:1.20 as builder
5+COPY . /app
6+WORKDIR /app
7+RUN go build -o pgit ./main.go
8+RUN ./pgit
9+
10+FROM nginx:latest
11+COPY --from=builder /app/public /usr/share/nginx/html
12 EXPOSE 80