Skip to content

Commit 56a3e1f

Browse files
committed
Adjust knex-migrator to be in the PATH directly instead of symlinking
1 parent f434a4b commit 56a3e1f

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

1/alpine/Dockerfile

+5-5
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ RUN set -ex; \
3939
mkdir -p "$GHOST_CONTENT"; \
4040
chown node:node "$GHOST_CONTENT"; \
4141
\
42-
# symlink knex-migrator bins into PATH
42+
# sanity check to ensure knex-migrator was installed
43+
"$GHOST_INSTALL/current/node_modules/knex-migrator/bin/knex-migrator" --version
44+
45+
# add knex-migrator bins into PATH
4346
# we want these from the context of Ghost's "node_modules" directory (instead of doing "npm install -g knex-migrator") so they can share the DB driver modules
44-
for f in "$GHOST_INSTALL/current/node_modules/.bin/knex-migrator"*; do \
45-
[ -x "$f" ]; \
46-
ln -svf "$f" /usr/local/bin/; \
47-
done
47+
ENV PATH $PATH:$GHOST_INSTALL/current/node_modules/knex-migrator/bin
4848

4949
# TODO multiarch sqlite3 (once either "node:6-alpine" has multiarch or we switch to a base that does)
5050

1/debian/Dockerfile

+5-5
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ RUN set -ex; \
4444
mkdir -p "$GHOST_CONTENT"; \
4545
chown node:node "$GHOST_CONTENT"; \
4646
\
47-
# symlink knex-migrator bins into PATH
47+
# sanity check to ensure knex-migrator was installed
48+
"$GHOST_INSTALL/current/node_modules/knex-migrator/bin/knex-migrator" --version
49+
50+
# add knex-migrator bins into PATH
4851
# we want these from the context of Ghost's "node_modules" directory (instead of doing "npm install -g knex-migrator") so they can share the DB driver modules
49-
for f in "$GHOST_INSTALL/current/node_modules/.bin/knex-migrator"*; do \
50-
[ -x "$f" ]; \
51-
ln -svf "$f" /usr/local/bin/; \
52-
done
52+
ENV PATH $PATH:$GHOST_INSTALL/current/node_modules/knex-migrator/bin
5353

5454
RUN set -eux; \
5555
# force install "sqlite3" manually since it's an optional dependency of "ghost"

0 commit comments

Comments
 (0)