25 lines
710 B
Docker
Raw Normal View History

2023-02-22 04:13:11 -06:00
FROM golang:1-alpine3.17 AS binary
ENV DOCKERIZE_VERSION v0.6.1
2023-02-22 04:13:11 -06:00
WORKDIR /go/src/github.com/jwilder
RUN apk --no-cache --update add openssl git tar curl
WORKDIR /go/src/github.com/jwilder/dockerize
RUN go install github.com/jwilder/dockerize@$DOCKERIZE_VERSION
FROM alpine:3
# PFP-260: Upgrade Sqlite to >=3.28.0-r0 to fix https://security.snyk.io/vuln/SNYK-ALPINE39-SQLITE-449762
RUN apk add --no-cache postgresql-client sqlite
2023-02-22 04:13:11 -06:00
COPY --from=binary /go/bin/dockerize /usr/local/bin
COPY docker/postgres-setup/init.sql /init.sql
COPY docker/postgres-setup/init.sh /init.sh
RUN chmod 755 init.sh
ENV DATAHUB_DB_NAME="datahub"
CMD dockerize -wait tcp://$POSTGRES_HOST:$POSTGRES_PORT -timeout 240s /init.sh