-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.frontend
More file actions
48 lines (32 loc) · 940 Bytes
/
Dockerfile.frontend
File metadata and controls
48 lines (32 loc) · 940 Bytes
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
# ----- Base image -----
from node:dubnium-alpine as base
# Add common deps and handle SIGTERMs
RUN apk add --update git tini
ENTRYPOINT ["/sbin/tini", "--"]
# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Copy dependencies manifests
COPY package.json yarn.lock /usr/src/app/
# ----- Create App Bundle -----
from base as bundler
# Add additional native deps required for build
RUN apk add python make g++
# Install app dependencies
RUN yarn install
# Add app source
COPY . /usr/src/app
# Bundle app
RUN yarn run bundle:js
# ----- Create Release -----
from base
ENV NODE_ENV=production
# Add bundle and server
COPY babel.config.js jsdoc.json /usr/src/app/
COPY --from=bundler /usr/src/app/build/* /usr/src/app/static/
COPY ./server /usr/src/app/server
# Install app dependencies
RUN yarn install --production
# Expose and run
EXPOSE 3000
CMD [ "node", "--max_old_space_size=4096", "server/index.js" ]