-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (25 loc) · 1.16 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
FROM nginx
# Update repo listings
RUN apt-get update
# Install system level things
RUN apt-get -y install git pandoc curl wget gnupg
# Install NodeJS and NPM
RUN cd /tmp && curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get -y install nodejs npm
RUN apt-get -y install build-essential
COPY . /tmp/apitax/build
# Add config prior to building
#RUN echo "var config = {}; config.endpoints.core = '${ENDPOINT_CORE}'; module.exports = config;" >> config.js
#RUN echo "window.appConfig = { API_URL: '${API_URL}'} " >> config.js
# Navigate to the web directory and install npm packages and build using webpack
RUN cd /tmp/apitax/build && npm install
#&& npm run build
# Move the build JavaScript to the the nginx directory
#RUN cp -r /tmp/apitax/build/dist /usr/share/nginx/html/dist
COPY src/pages /usr/share/nginx/html
#RUN rm -rf /tmp/apitax
COPY config.sh /tmp/apitax/build
RUN ["chmod", "+x", "/tmp/apitax/build/config.sh"]
RUN ls -alh /tmp/apitax/build
CMD bash /tmp/apitax/build/config.sh
#&& npm run --prefix /tmp/apitax/build build && cp -r /tmp/apitax/build/dist /usr/share/nginx/html/dist && rm -rf /tmp/apitax