-
Notifications
You must be signed in to change notification settings - Fork 11
/
Dockerfile
58 lines (39 loc) · 1.13 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
46
47
48
49
50
51
52
53
54
55
56
57
58
FROM ubuntu:20.04 as base
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update -y && apt-get install -y \
apt-transport-https \
curl \
make \
gcc \
g++
# nodejs
RUN curl -sL https://deb.nodesource.com/setup_18.x | bash
# install depdencies and enable corepack
RUN apt-get update -y && apt-get install -y --allow-unauthenticated nodejs
RUN corepack enable
# Set cache dir so it can be shared between different docker stages
RUN yarn config set cache-folder /tmp/yarn-cache
FROM base as setup
# AFJ specifc setup
WORKDIR /www
# Copy root package files
COPY package.json /www/package.json
COPY yarn.lock /www/yarn.lock
# Run yarn install
RUN yarn install
COPY tsconfig.build.json /www/tsconfig.build.json
COPY . /www
RUN yarn build
FROM base as final
WORKDIR /www
COPY --from=setup /www/build /www/build
COPY --from=setup /tmp/yarn-cache /tmp/yarn-cache
# Copy root package files and mediator app package
COPY package.json /www/package.json
COPY yarn.lock /www/yarn.lock
WORKDIR /www
# Run yarn install
RUN yarn install --production
# Clean cache to reduce image size
RUN yarn cache clean
ENTRYPOINT [ "yarn", "start" ]