-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (23 loc) · 823 Bytes
/
Dockerfile
File metadata and controls
37 lines (23 loc) · 823 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
FROM openpitrix/dashboard-env-slim:v0.2.0 as builder
MAINTAINER sunnyw <sunnywang@yunify.com>
ARG SKIP_NODE_SASS_TESTS=true
ENV PATH=$PATH:/app/node_modules/.bin
WORKDIR /app
RUN mkdir -p /app
COPY package.json yarn.lock /tmp/
RUN cd /tmp && mkdir -p node_modules \
&& yarn install --pure-lockfile --prefer-offline \
&& mv node_modules dev_node_modules \
&& NODE_ENV=production yarn install --pure-lockfile --prod --prefer-offline \
&& mv node_modules prod_node_modules \
&& mv dev_node_modules node_modules
COPY . /app
RUN cd /app && ln -fs /tmp/node_modules && yarn prod:build
FROM node:8-alpine
ENV NODE_ENV=production
WORKDIR /app
RUN mkdir -p /app
COPY --from=builder /app /app
COPY --from=builder /tmp/prod_node_modules /app/node_modules
EXPOSE 8000
CMD ["npm", "run", "prod:serve"]