-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile.prod
35 lines (30 loc) · 985 Bytes
/
Dockerfile.prod
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
FROM debian:bullseye as builder
ENV TZ=America/New_York
ENV PATH=/go/bin:$PATH
ENV GOROOT=/go
ENV GOPATH=/src/go
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone &&\
mkdir /go &&\
mkdir -p /src/go &&\
apt update &&\
apt -y install build-essential &&\
apt -y install gdal-bin gdal-data libgdal-dev &&\
apt -y install wget &&\
wget https://golang.org/dl/go1.19.5.linux-amd64.tar.gz -P / &&\
tar -xvzf /go1.19.5.linux-amd64.tar.gz -C / &&\
apt -y install vim &&\
apt -y install git
WORKDIR /app
RUN git clone https://github.com/USACE/go-consequences.git
WORKDIR /app/go-consequences
RUN go mod download
RUN go mod tidy
RUN go build main.go
FROM ghcr.io/osgeo/gdal:ubuntu-full-3.8.3 as prod
RUN apt update &&\
apt -y install build-essential &&\
apt -y install pkg-config &&\
apt -y install gdal-bin gdal-data libgdal-dev
WORKDIR /app
COPY --from=builder /app/go-consequences/main .
ENTRYPOINT ["/main"]