Skip to content

Commit 3286464

Browse files
committed
build dbmate and then install client
1 parent 2bf4ad4 commit 3286464

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

migrations/Dockerfile.dbmate

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
FROM amacneil/dbmate:1.16.2
1+
FROM debian:bullseye-slim
2+
3+
RUN apt-get update && apt-get install -y curl \
4+
&& curl -fsSL -o /usr/local/bin/dbmate https://github.com/amacneil/dbmate/releases/latest/download/dbmate-linux-amd64 \
5+
&& chmod +x /usr/local/bin/dbmate
26

3-
# Install PostgreSQL 16 client
47
RUN apt-get update && apt-get install -y wget gnupg2 lsb-release
58
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
69
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
710
RUN apt-get update && apt-get install -y postgresql-client-%VERSION%
811

9-
# Set the PATH to use the new PostgreSQL 16 binaries
10-
ENV PATH="/usr/lib/postgresql/%VERSION%/bin:${PATH}"
12+
ENV PATH="/usr/lib/postgresql/%VERSION%/bin:${PATH}"
13+
14+
ENTRYPOINT ["dbmate"]

0 commit comments

Comments
 (0)