-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
46 lines (30 loc) · 790 Bytes
/
Dockerfile
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
40
41
42
43
44
45
46
FROM golang:1.17-alpine AS builder
RUN apk add --no-cache git make build-base
ENV GO111MODULE=on
ENV CGO_ENABLED=1
ENV GOOS=linux
ENV GOARCH=amd64
ENV GOSUMDB=off
ENV GOPROXY=direct
ENV GOOGLE_CHROME_PATH = "/usr/bin/google-chrome"
ENV PATH="${GOOGLE_CHROME_PATH}:${PATH}"
ENV PATH_TO_DB="/pricewatcher.db"
WORKDIR /app
COPY go.mod .
COPY go.sum .
COPY pricewatcher.db .
RUN go mod download
COPY . .
RUN go build -o ./main
FROM alpine:3.14
RUN apk add --no-cache iputils busybox-extras curl
WORKDIR /app
COPY --from=builder /app/main .
RUN chmod 777 /app/main
RUN mkdir /app/db
COPY pricewatcher.db /app/db/pricewatcher.db
COPY --from=builder /usr/local/go/lib/time/zoneinfo.zip .
ENV TZ=Europe/Moscow
ENV ZONEINFO=/app/zoneinfo.zip
RUN ls -l -R
ENTRYPOINT ["/app/main"]