-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
44 lines (33 loc) · 1.02 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
# -------------------------------------------------------------------
# BASE IMAGE
# -------------------------------------------------------------------
FROM node:8.11.0@sha256:d4f30a5e6229ecea698f1d0499576b1df170e949fb8fd98631296cd260598a47 as BASE
ARG PORT=4000
ENV PORT=$PORT
ENV HOME /opt/web-core
ENV NPM_CONFIG_LOGLEVEL warn
ARG APP_ENV=development
ENV APP_ENV=$APP_ENV
RUN mkdir -p $HOME
WORKDIR $HOME
COPY package.json ./
RUN npm install --silent
RUN npm rebuild node-sass
## -------------------------------------------------------------------
## RELEASE
## -------------------------------------------------------------------
COPY ./ ./
CMD if [ ${APP_ENV} = production ]; \
then \
echo "Production mode ..." && \
npm rebuild node-sass && \
npm install -g http-server && \
npm run build && \
cd build && \
hs -p ${PORT}; \
else \
echo "Development mode ..." && \
npm rebuild node-sass && \
npm run start; \
fi
EXPOSE $PORT