3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
18 #RUN apt-get update && apt-get install -y npm git python-pip nginx supervisor curl software-properties-common libssl-dev libmysqlclient-dev mysql-client
20 && DEBIAN_FRONTEND=noninteractive apt-get install -y curl \
21 software-properties-common \
26 libmariadbclient-dev \
30 && DEBIAN_FRONTEND=noninteractive apt-get install -y npm
32 RUN echo "daemon off;" >> /etc/nginx/nginx.conf
34 ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
35 ARG RELEASE=ReleaseEIGHT-daily
36 ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg
37 ARG REPOSITORY=testing
40 RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add -
41 RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} LW-UI" && apt-get update
43 RUN DEBIAN_FRONTEND=noninteractive apt-get install -y osm-lightui${LWUI_VERSION} \
45 && rm -rf /var/lib/apt/lists/*
47 WORKDIR /usr/share/osm-lightui
48 RUN npm install -g npm@latest
50 RUN mv node_modules ./static
51 RUN pip install -r requirements.txt
53 RUN cp /usr/share/osm-lightui/nginx-app.conf /etc/nginx/sites-available/default
54 RUN cp /usr/share/osm-lightui/supervisor-app.conf /etc/supervisor/conf.d/
56 # delete the copy of the database inside the container (if exists)
61 # ENV OSMUI_SQL_DATABASE_URI=mysql://root:secret@mysql:3306/lwui
62 RUN python manage.py collectstatic --noinput
63 RUN chmod +x /usr/share/osm-lightui/entrypoint.sh
67 HEALTHCHECK --start-period=130s --interval=10s --timeout=5s --retries=12 \
68 CMD curl --silent --fail localhost:80 || exit 1
70 CMD ["/usr/share/osm-lightui/entrypoint.sh"]