Skip to content

Commit

Permalink
fix: fixes to use alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
bconn98 committed May 18, 2024
1 parent b0c236a commit f1c4ff7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
bld-and-push:
strategy:
matrix:
version: ['13-alpine', '14-alpine', '15-alpine', '16-alpine']
version: ['13', '14', '15', '16']
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
17 changes: 3 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
ARG POSTGRES_VERSION=12.1
FROM postgres:${POSTGRES_VERSION}-bullseye
LABEL org.opencontainers.image.authors="[email protected]"

RUN \
apt-get update && \
apt-get install -y cron && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ARG POSTGRES_VERSION=16
FROM postgres:${POSTGRES_VERSION}-alpine
LABEL org.opencontainers.image.authors="[email protected]"

EXPOSE 5432
ENV PGDATA="/data"
Expand All @@ -23,16 +17,11 @@ USER root
RUN \
chmod 755 dump.sh && \
chmod 755 entrypoint.sh && \
chmod gu+rw /var/run && \
chmod gu+s /usr/sbin/cron && \
mkdir ${PGDUMP} && \
chown ${PGUSER}:${PGUSER} ${PGDUMP} && \
mkdir ${PGDATA} && \
chown ${PGUSER}:${PGUSER} ${PGDATA}

VOLUME [ "${PGDUMP}", "${PGDATA}" ]

USER ${PGUSER}

ENTRYPOINT ["bash", "/entrypoint.sh"]
CMD ["dump-cron"]
5 changes: 3 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# entrypoint.sh
set -e

crond
su - ${PGUSER}

if [[ -z $COMMAND ]];
then
COMMAND=${1:-dump-cron}
Expand Down Expand Up @@ -92,8 +95,6 @@ elif [[ "${COMMAND}" == 'dump-cron' ]]; then
fi

echo -e "$CRON_ENV\n$CRON_SCHEDULE /dump.sh > $LOGFIFO 2>&1" | crontab -
# crontab -l
cron

if [[ "${RUN_DOUBLE}" == "false" ]];
then
Expand Down

0 comments on commit f1c4ff7

Please sign in to comment.