-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (29 loc) · 1.01 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
FROM node:14.15.4 as build
# set working directory
RUN mkdir /usr/src/app
WORKDIR /usr/src/app
RUN curl -L -o elm.gz https://github.com/elm/compiler/releases/download/0.19.1/binary-for-linux-64-bit.gz \
&& gunzip elm.gz \
&& chmod +x elm \
&& mv elm /usr/local/bin/ \
&& elm --help
# add `/usr/src/app/node_modules/.bin` to $PATH
ENV PATH /usr/src/app/node_modules/.bin:$PATH
# install and cache app dependencies
COPY package.json /usr/src/app/package.json
RUN rm -rf /root/.node-gyp
# add app
COPY . /usr/src/app
RUN npm install
RUN npm rebuild node-sass
RUN npm run package
#production stage
FROM httpd:2.4-alpine
ENV BACKEND_URL=https://backend.wen.pm
COPY --from=build /usr/src/app/dist /usr/local/apache2/htdocs
COPY devops /usr/local/apache2/devops
# Note: the assets folder is currently not bein included in the images
RUN ls -l /usr/local/apache2
RUN echo "Include devops/*.conf" >> /usr/local/apache2/conf/httpd.conf
ENTRYPOINT ["/usr/local/apache2/devops/configure.sh"]
CMD ["httpd-foreground"]