mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
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
|
FROM ghcr.io/bigcapitalhq/server:latest as build
|
||||||
|
|
||||||
USER root
|
|
||||||
RUN apk update && \
|
|
||||||
apk upgrade && \
|
|
||||||
apk add git
|
|
||||||
|
|
||||||
RUN apk add --no-cache bash
|
|
||||||
|
|
||||||
ARG DB_HOST= \
|
ARG DB_HOST= \
|
||||||
DB_USER= \
|
DB_USER= \
|
||||||
@@ -29,28 +22,16 @@ ENV DB_HOST=$DB_HOST \
|
|||||||
SYSTEM_DB_NAME=$SYSTEM_DB_NAME \
|
SYSTEM_DB_NAME=$SYSTEM_DB_NAME \
|
||||||
SYSTEM_DB_CHARSET=$SYSTEM_DB_CHARSET
|
SYSTEM_DB_CHARSET=$SYSTEM_DB_CHARSET
|
||||||
|
|
||||||
# Create app directory.
|
USER root
|
||||||
WORKDIR /app
|
RUN apk update && \
|
||||||
|
apk upgrade && \
|
||||||
|
apk add git
|
||||||
|
|
||||||
RUN chown node:node /
|
RUN apk add --no-cache bash
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
# Change working dir to the server package.
|
# Change working dir to the server package.
|
||||||
WORKDIR /app/packages/server
|
WORKDIR /app/packages/server
|
||||||
|
|
||||||
RUN git clone https://github.com/vishnubob/wait-for-it.git
|
RUN git clone https://github.com/vishnubob/wait-for-it.git
|
||||||
|
|
||||||
# Once we listen the mysql port run the migration task.
|
# Once we listen the mysql port run the migration task.
|
||||||
|
|||||||
Reference in New Issue
Block a user