-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
36 lines (24 loc) · 940 Bytes
/
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
# build
FROM node:dubnium-alpine as webapp
ARG browser_env
ENV browser_env $browser_env
# nginx
RUN apk update && apk add nginx
RUN rm -rf /etc/nginx/conf.d/default.conf
RUN mkdir -p /kiworkshop/logs/nginx/
RUN mkdir -p /kiworkshop/service/static
COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
# app
RUN mkdir -p /usr/local/community-web/
WORKDIR /usr/local/community-web/
RUN mkdir -p pages public scripts server src templates
COPY pages pages/
COPY public public/
COPY scripts scripts/
COPY server server/
COPY src src/
COPY templates templates/
COPY .babelrc jest.config.js next-env.d.ts next.config.js nodemon.json package-lock.json package.json tsconfig.json tslint.json ./
RUN export $(echo $browser_env) > /dev/null && npm install && npm run build && rm -rf node_modules && npm install --production
ENTRYPOINT [ "sh", "-c", "nohup nginx -g 'daemon off;' & export $(echo $application_env) > /dev/null && npm run start" ]