Merge pull request #100 from bigcapitalhq/migration-container-server-layer
fix: use the docker server image layer in migration image
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user