2024-03-30 02:29:56 +00:00
|
|
|
FROM alpine:3.19
|
2024-05-23 16:15:02 +00:00
|
|
|
|
|
|
|
# install packages
|
|
|
|
RUN apk add --no-cache tini shadow
|
|
|
|
RUN rm -fr /var/cache/apk/*
|
|
|
|
|
|
|
|
# setup main user
|
|
|
|
RUN adduser -D postgrest
|
|
|
|
RUN groupmod --gid 1000 postgrest
|
|
|
|
RUN usermod --uid 1000 postgrest
|
|
|
|
|
|
|
|
# install postgrest
|
2024-03-30 02:29:56 +00:00
|
|
|
COPY ./postgrest.tar.xz /tmp/postgrest.tar.xz
|
2024-05-23 16:15:02 +00:00
|
|
|
RUN tar xJf /tmp/postgrest.tar.xz -C /usr/local/bin
|
2024-03-30 02:29:56 +00:00
|
|
|
RUN rm /tmp/postgrest.tar.xz
|
2024-05-23 16:15:02 +00:00
|
|
|
|
|
|
|
# copy scripts
|
2024-03-30 02:29:56 +00:00
|
|
|
COPY ./entrypoint.sh /usr/local/bin/entrypoint.sh
|
|
|
|
|
2024-05-23 16:15:02 +00:00
|
|
|
# remove build packages
|
|
|
|
RUN apk del shadow
|
|
|
|
|
|
|
|
# make the dirs
|
|
|
|
RUN mkdir -p /etc/postgrest.d && \
|
|
|
|
chown postgrest:postgrest /etc/postgrest.d
|
2024-03-30 02:29:56 +00:00
|
|
|
|
2024-05-23 16:15:02 +00:00
|
|
|
# do the
|
|
|
|
USER postgrest
|
|
|
|
ENTRYPOINT ["/sbin/tini", "--"]
|
|
|
|
CMD ["/usr/local/bin/entrypoint.sh"]
|