aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/Dockerfile.tools
blob: 7d38230c5c662e3a5c040593b2aa743ca8c3bdd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
FROM golang:1.23.6

WORKDIR /tools

COPY go.mod go.sum ./
RUN go mod download

RUN wget -O psqldef.tar.gz https://github.com/sqldef/sqldef/releases/download/v0.17.14/psqldef_linux_amd64.tar.gz

RUN tar -xzf psqldef.tar.gz && \
    rm -f psqldef.tar.gz

RUN touch /usr/local/bin/psqldef && \
    echo '#!/bin/sh' >> /usr/local/bin/psqldef && \
    echo '/tools/psqldef --user="$POSTGRES_USER" --password="$POSTGRES_PASSWORD" --host=db "$POSTGRES_DB" "$@"' >> /usr/local/bin/psqldef && \
    chmod +x /usr/local/bin/psqldef