From 0c8d0b7f3cc804e98751ddebade67949336ef998 Mon Sep 17 00:00:00 2001 From: "R. Tyler Croy" Date: Mon, 22 Oct 2018 10:34:19 -0700 Subject: [PATCH] Ensure that migrations are run when the container boots This is a little derpy, but the simplest way to reliable get these migrations to execute along with application deployments --- .dockerignore | 1 + Dockerfile | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..c2658d7 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +node_modules/ diff --git a/Dockerfile b/Dockerfile index a643f7e..86afc7e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,8 @@ COPY migrations ${APP_DIR}/migrations COPY config ${APP_DIR}/config COPY public ${APP_DIR}/public COPY views ${APP_DIR}/views +COPY .sequelizerc ${APP_DIR}/ EXPOSE 3030 -CMD node ./build/ +CMD node ./node_modules/.bin/sequelize db:migrate && node ./build/