forked from change-metrics/monocle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-web
54 lines (42 loc) · 1.67 KB
/
Dockerfile-web
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
# Monocle.
# Copyright (C) 2019-2020 Monocle authors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# base image
FROM registry.fedoraproject.org/fedora:33
RUN dnf update -y && dnf install -y nodejs git
# set working directory
WORKDIR /app
# add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH
# copy files to install js modules
COPY package.json /app/
COPY bsconfig.json /app/
COPY package-lock.json /app/
# install dependencies
RUN npm install
# copy source files
COPY build.js /app/
COPY public /app/public/
COPY src /app/src/
# install dependencies (sed is ugly hack to make warning errors)
RUN sed -e 's|-bs-no-version-header|-bs-no-version-header", "-warn-error -a+5+6+27+101+109|' -i bsconfig.json && npm run build
################################################################################
FROM docker.io/library/nginx:1.21.3
COPY --from=0 /app/build /app
COPY conf/start.sh /bin/
COPY conf/nginx.conf /etc/nginx/nginx.conf
# Ensure anyuid can run the nginx process
RUN chmod -R 0777 /var /run /app/index.html /etc/nginx/nginx.conf
CMD /bin/start.sh