-
Notifications
You must be signed in to change notification settings - Fork 281
/
Copy pathDockerfile.engine
42 lines (42 loc) · 1.66 KB
/
Dockerfile.engine
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
# Copyright (C) 2019-2025 GEM Foundation
#
# OpenQuake 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.
#
# OpenQuake 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 OpenQuake. If not, see <http://www.gnu.org/licenses/>.
FROM python:3.11.6-slim AS compile-image
LABEL maintainer="GEM Foundation <devops@openquake.org>" \
vendor="GEM Foundation"
RUN useradd -m -u 1000 -s /bin/bash openquake
RUN apt-get update && apt-get install -y --no-install-recommends build-essential gcc git libcap-dev
ARG oq_branch
# Create venv
ENV VIRTUAL_ENV=/opt/openquake
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
#clone repository and install engine
RUN git clone https://github.com/gem/oq-engine.git --depth=1 --branch $oq_branch && cd oq-engine && \
pip --disable-pip-version-check install . -r requirements-py311-linux64.txt --no-warn-script-location
#
FROM python:3.11.6-slim AS build-image
COPY --from=compile-image /opt/openquake/ /opt/openquake/
ENV LANG en_US.UTF-8
ENV LOCKDOWN=False
RUN useradd -m -u 1000 -s /bin/bash openquake
USER openquake
ENV HOME /home/openquake
WORKDIR ${HOME}
ENV PATH="/opt/openquake/bin:$PATH"
#
RUN mkdir oqdata
EXPOSE 8800:8800
STOPSIGNAL SIGINT
ENTRYPOINT ["/bin/bash", "-c"]