-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (27 loc) · 922 Bytes
/
Dockerfile
File metadata and controls
36 lines (27 loc) · 922 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
FROM golang:1.21.1-alpine as build
ARG CGO_ENABLED=0
ARG GOOS=linux
ARG GOARCH=amd64
ARG GOSUMDB=off
WORKDIR /go/build
RUN apk add --no-cache git
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN export REVISION=$TAG-$(date +'%Y%m%dT%H%M%S') && \
go build -o finviz -ldflags "-X main.revision=$REVISION -s -w" ./cmd
FROM alpine:3.11 as release
RUN apk add --no-cache --update tzdata && \
cp /usr/share/zoneinfo/Europe/Moscow /etc/localtime && \
rm -rf /var/cache/apk/*
WORKDIR /app
ENV MIGRATE_VERSION=4.16.2
RUN wget https://github.com/golang-migrate/migrate/releases/download/v${MIGRATE_VERSION}/migrate.linux-amd64.tar.gz && \
tar -xvzpf migrate.linux-amd64.tar.gz && \
mv migrate.linux-amd64 migrate && \
chmod 755 migrate && \
rm -f *.tar.gz && \
./migrate -version
COPY migrations migrations
COPY --from=build /go/build/finviz ./
CMD ["/app/finviz"]