forked from nvdnkpr/api-notebook
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (40 loc) · 1.15 KB
/
Dockerfile
File metadata and controls
51 lines (40 loc) · 1.15 KB
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
#################
# BUILD CONTAINER
FROM devdocker.mulesoft.com:18078/mulesoft/core-paas-base-image-node-8.12:v2.0.7 as BUILD
USER root
# Add dependencies and setup working directory
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git \
phantomjs \
bzip2 \
&& rm -rf /var/lib/apt/lists/*
# Install and cache node_modules/
COPY --chown=app:app package*.json /code/
WORKDIR /code
USER app
RUN npm set progress=false && \
npm install -s --no-progress
# Build project
COPY . /code
RUN npm run build && \
npm prune -s --production
###################
# RUNTIME CONTAINER
FROM devdocker.mulesoft.com:18078/mulesoft/core-paas-base-image-ubuntu:v2.2.149
# Intall build dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
python \
&& rm -rf /var/lib/apt/lists/*
# Add app user
RUN groupadd -g 2020 app
RUN useradd -u 2020 -g 2020 -r -m -d /usr/src/app app
# Copy built artifacts from build container
COPY --from=BUILD /code/build /usr/src/app
# Copy python server file
COPY --chown=app:app server.py /usr/src/app/
WORKDIR /usr/src/app
USER app
EXPOSE 3000
CMD ["python", "server.py", "'/'", "3000"]