-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
80 lines (57 loc) · 2.42 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# # first install java 8 for compiling pellet
FROM openjdk:8 as pellet-build
# update apt-get
RUN apt-get update
# install rapper and maven
RUN apt-get install -y maven git zip
# download and compile pellet
RUN mkdir /usr/lib/pellet/
RUN mvn --version
RUN git clone https://github.com/stardog-union/pellet.git /usr/lib/pellet/
RUN mvn clean install -f /usr/lib/pellet/pom.xml -DskipTests=true
# here we go with python 3.10
FROM python:3.10-slim-bullseye
# Configure Poetry
ENV POETRY_VERSION=1.6.1
ENV POETRY_HOME=/opt/poetry
ENV POETRY_VENV=/opt/poetry-venv
ENV POETRY_CACHE_DIR=/opt/.cache
# add archivo user
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# the required deploy directory for databus data and the directory for the data
RUN mkdir -p /home/dstreitmatter/www/archivo/
RUN mkdir -p /usr/local/archivo-data/
# install rapper and java
## Install required packages for downloading and adding bellsoft repository
RUN apt-get update && apt-get install -y wget gnupg2 ca-certificates
## Add the BellSoft GPG key and repository for java-8/11 etc
RUN wget -qO - https://download.bell-sw.com/pki/GPG-KEY-bellsoft | apt-key add - \
&& echo "deb [arch=amd64] https://apt.bell-sw.com/ stable main" > /etc/apt/sources.list.d/bellsoft.list
RUN apt-get update
RUN apt-get install -y bellsoft-java11
RUN apt-get install -y raptor2-utils git zip unzip
# copy pellet to new image and make it executeable
COPY --from=pellet-build /usr/lib/pellet/ /usr/lib/pellet/
RUN chmod +x /usr/lib/pellet/cli/target/pelletcli/bin/pellet
# Install poetry separated from system interpreter
RUN python3 -m venv $POETRY_VENV \
&& $POETRY_VENV/bin/pip install -U pip setuptools \
&& $POETRY_VENV/bin/pip install poetry==${POETRY_VERSION}
# Add `poetry` to PATH
ENV PATH="${PATH}:${POETRY_VENV}/bin"
# copy local directory
COPY poetry.lock pyproject.toml /usr/local/src/webapp/archivo/
# set up project directory
ENV WDIR /usr/local/src/webapp/archivo/archivo
ENV REPO_DIR /usr/local/src/webapp/archivo
# set repo dir as working dir for installation
WORKDIR ${REPO_DIR}
# install packages
RUN poetry install --no-dev
# set WDIR as working dir for execution
WORKDIR ${WDIR}
#Expose the required port
EXPOSE 5000
#Run the command
# CMD ["./startup.sh"]
CMD ["poetry", "run", "gunicorn","--bind", "0.0.0.0:5000", "--workers=6", "archivo:app", "--access-logfile", "./logs/gunicorn-access.log", "--log-file", "./logs/gunicorn-errors.log", "--timeout", "1200", "--preload"]