-
Notifications
You must be signed in to change notification settings - Fork 19
/
Dockerfile
81 lines (54 loc) · 1.41 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#build environment
FROM node as builder
RUN mkdir /usr/src/app
WORKDIR /usr/src/app
ENV PATH /usr/src/app/node_modules/.bin:$PATH
COPY package.json /usr/src/app/package.json
COPY public/ /usr/src/app/public/
COPY src/ /usr/src/app/src/
RUN yarn install --silent
RUN yarn global add sass
RUN yarn sass
RUN yarn build
#production environment
FROM nginx:1.13.9-alpine
COPY --from=builder /usr/src/app/build /usr/share/nginx/html
COPY nginx.conf etc/nginx/nginx.conf
COPY config-template.js /config-template.js
COPY replace.sh /replace.sh
EXPOSE 443
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
# FROM node AS build
# WORKDIR /app
# COPY . .
# FROM nginx:1.15.2-alpine
# COPY - from=build /app/build /var/www
# COPY ./nginx.conf /etc/nginx/conf.d/default.conf
# COPY nginx.conf /etc/nginx/nginx.conf
# EXPOSE 80
# ENTRYPOINT ["nginx", "-g", "daemon off;"]
# if left blank app will run with dev settings
# to build production image run:
# $ docker build ./frontend --build-args app_env=production
# ENV NPM_CONFIG_LOGLEVEL warn
# FROM node
# COPY ./ ./
# RUN yarn install
# RUN yarn global add sass
# RUN yarn sass
# RUN yarn build
# EXPOSE 8080
# CMD yarn server
# USEFUL COMMANDS TO BE REINCLUDED LATER
# ARG app_env
# ENV NODE_ENV $app_env
# CMD if [ ${NODE_ENV} = production ]; \
# then \
# npm install -g http-server && \
# npm run build && \
# cd build && \
# hs -p 3000; \
# else \
# npm run start; \
# fi