diff --git a/docker/migration/Dockerfile b/docker/migration/Dockerfile index 817379495..18f9383d9 100644 --- a/docker/migration/Dockerfile +++ b/docker/migration/Dockerfile @@ -1,11 +1,4 @@ -FROM node:14.20-alpine as build - -USER root -RUN apk update && \ - apk upgrade && \ - apk add git - -RUN apk add --no-cache bash +FROM ghcr.io/bigcapitalhq/server:latest as build ARG DB_HOST= \ DB_USER= \ @@ -29,28 +22,16 @@ ENV DB_HOST=$DB_HOST \ SYSTEM_DB_NAME=$SYSTEM_DB_NAME \ SYSTEM_DB_CHARSET=$SYSTEM_DB_CHARSET -# Create app directory. -WORKDIR /app +USER root +RUN apk update && \ + apk upgrade && \ + apk add git -RUN chown node:node / - -# Copy application dependency manifests to the container image. -COPY ./package*.json ./ -COPY ./packages/server/package*.json ./packages/server/ - -COPY ./lerna.json ./lerna.json - -# Install app dependencies for production. -RUN npm install -RUN npm run bootstrap - -COPY --chown=node:node ./packages/server ./packages/server - -# Build the server package. -RUN npm run build:server +RUN apk add --no-cache bash # Change working dir to the server package. WORKDIR /app/packages/server + RUN git clone https://github.com/vishnubob/wait-for-it.git # Once we listen the mysql port run the migration task.