-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
45 lines (27 loc) · 1.1 KB
/
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
# Copyright 2021 Adevinta
FROM --platform=$BUILDPLATFORM golang:1.24-alpine AS builder
WORKDIR /app
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
ARG TARGETOS TARGETARCH
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go build ./cmd/vulcan-reports-generator
FROM alpine:3.21
WORKDIR /flyway
RUN apk add --no-cache postgresql-client openjdk17-jre bash gettext libc6-compat
ARG FLYWAY_VERSION=10.10.0
RUN wget -q https://repo1.maven.org/maven2/org/flywaydb/flyway-commandline/${FLYWAY_VERSION}/flyway-commandline-${FLYWAY_VERSION}.tar.gz \
&& tar -xzf flyway-commandline-${FLYWAY_VERSION}.tar.gz --strip 1 \
&& rm flyway-commandline-${FLYWAY_VERSION}.tar.gz \
&& find ./drivers/ -type f -not -name '*postgres*' -not -name '*jackson*' -delete \
&& chown -R root:root . \
&& ln -s /flyway/flyway /bin/flyway
WORKDIR /app
COPY db/sql /app/sql/
COPY --from=builder /app/vulcan-reports-generator .
# copy generators resources, this is provided by go generate
COPY _build/files/opt/vulcan-reports-generator/generators /app/resources/generators
COPY config.toml .
COPY run.sh .
CMD [ "./run.sh" ]