-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
45 lines (38 loc) · 1.67 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
FROM registry.access.redhat.com/ubi8/nodejs-14:1-35.1626836507 as base
# Install yarn
RUN npm install -g yarn
# Copy monorepo general contents
COPY ./package*.json .
COPY ./yarn.lock .
COPY ./tsconfig.json ./tsconfig.json
COPY ./tsconfig.base.json ./tsconfig.base.json
COPY ./jest.config.js ./jest.config.js
# Copy package and dependent packages
COPY ./packages/core ./packages/core
COPY ./packages/product-backend ./packages/product-backend
COPY ./packages/product-mapping-backend ./packages/product-mapping-backend
COPY ./packages/price-backend ./packages/price-backend
COPY ./packages/product-experience-api ./packages/product-experience-api
COPY ./packages/configuration-backend ./packages/configuration-backend
# Chown to correct user
USER 0
RUN chown -R 1001:0 ${APP_ROOT} && chmod -R ug+rwx ${APP_ROOT} && \
rpm-file-permissions
USER 1001
# Run install for all required packages
RUN yarn workspace @verkkokauppa/core install
RUN yarn workspace @verkkokauppa/product-backend install
RUN yarn workspace @verkkokauppa/product-mapping-backend install
RUN yarn workspace @verkkokauppa/price-backend install
RUN yarn workspace @verkkokauppa/product-experience-api install
RUN yarn workspace @verkkokauppa/configuration-backend install
# Create production build
FROM base as production
RUN yarn workspace @verkkokauppa/core build
RUN yarn workspace @verkkokauppa/product-backend build
RUN yarn workspace @verkkokauppa/product-mapping-backend build
RUN yarn workspace @verkkokauppa/price-backend build
RUN yarn workspace @verkkokauppa/configuration-backend build
RUN yarn workspace @verkkokauppa/product-experience-api build
EXPOSE 8080
CMD yarn workspace @verkkokauppa/product-experience-api start -d