2020-09-02 17:43:48 +03:00
|
|
|
FROM node:10 as contracts
|
2020-07-14 21:53:05 +07:00
|
|
|
|
|
|
|
WORKDIR /mono
|
|
|
|
|
|
|
|
COPY contracts/package.json contracts/package-lock.json ./contracts/
|
|
|
|
|
|
|
|
WORKDIR /mono/contracts
|
|
|
|
RUN npm install --only=prod
|
|
|
|
|
|
|
|
COPY ./contracts/truffle-config.js ./
|
|
|
|
COPY ./contracts/contracts ./contracts
|
|
|
|
RUN npm run compile
|
|
|
|
|
2020-07-01 18:34:27 -03:00
|
|
|
FROM node:12 as alm-builder
|
2020-06-04 13:15:39 -03:00
|
|
|
|
|
|
|
WORKDIR /mono
|
|
|
|
COPY package.json .
|
2020-07-14 21:53:05 +07:00
|
|
|
COPY --from=contracts /mono/contracts/build ./contracts/build
|
2020-06-04 13:15:39 -03:00
|
|
|
COPY commons/package.json ./commons/
|
|
|
|
COPY alm/package.json ./alm/
|
|
|
|
COPY yarn.lock .
|
2020-07-14 21:53:05 +07:00
|
|
|
RUN NOYARNPOSTINSTALL=1 yarn install --frozen-lockfile --production
|
2020-06-04 13:15:39 -03:00
|
|
|
|
|
|
|
COPY ./commons ./commons
|
|
|
|
COPY ./alm ./alm
|
2020-07-14 21:53:05 +07:00
|
|
|
|
2020-06-04 13:15:39 -03:00
|
|
|
ARG DOT_ENV_PATH=./alm/.env
|
|
|
|
COPY ${DOT_ENV_PATH} ./alm/.env
|
|
|
|
|
|
|
|
WORKDIR /mono/alm
|
2020-07-01 18:34:27 -03:00
|
|
|
RUN yarn run build
|
|
|
|
|
|
|
|
|
|
|
|
FROM node:12 as alm-production
|
|
|
|
RUN yarn global add serve
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=alm-builder /mono/alm/build .
|
|
|
|
CMD serve -p $PORT -s .
|