Skip to content

Commit

Permalink
fix(sqitch): add docker entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
dargmuesli committed May 10, 2023
1 parent a3d059b commit 5f33e09
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions sqitch/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
##############################
FROM sqitch/sqitch AS development

WORKDIR /srv/app

COPY ./docker-entrypoint.sh /usr/local/bin/

VOLUME /srv/app

ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["sqitch", "deploy"]


###########################
FROM postgres:15.2 AS build

Expand Down
13 changes: 13 additions & 0 deletions sqitch/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
set -e

SQITCH_TARGET=''

if [ "$NODE_ENV" = 'production' ]; then
SQITCH_TARGET="$(cat /run/secrets/maevsi_sqitch-target)"
else
SQITCH_TARGET="$(cat "$PWD/SQITCH_TARGET.env")"
fi
export SQITCH_TARGET

exec "$@"

0 comments on commit 5f33e09

Please sign in to comment.