forked from elisa-tech/BASIL
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerfile-api-fedora
More file actions
43 lines (33 loc) · 1.25 KB
/
Copy pathContainerfile-api-fedora
File metadata and controls
43 lines (33 loc) · 1.25 KB
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
FROM registry.fedoraproject.org/fedora:39
USER root
RUN mkdir BASIL-API
WORKDIR /BASIL-API
# Install dependencies
RUN dnf install -y curl git jq patch python3 python3-pip podman rsync
COPY . .
RUN pip3 install --no-cache-dir -r requirements.txt
# Set the public ip in the api/api_url.py
ARG API_PORT=5000
ARG ADMIN_PASSWORD=admin
ENV BASIL_ADMIN_PASSWORD=${ADMIN_PASSWORD} BASIL_API_PORT=${API_PORT}
# Create directories
RUN mkdir -p /var/tmp && \
mkdir -p /BASIL-API/api/user-files
# Init the database and
# Write permission to db
RUN cd /BASIL-API/db/models && \
python3 init_db.py && \
chmod a+rw /BASIL-API/db
# Apply patches
RUN patch -u /usr/local/lib/python3.12/site-packages/tmt/steps/provision/podman.py < /BASIL-API/misc/tmt_provision_podman.patch
# Init tmt
RUN tmt init
# Remove BASIL ADMIN PASSWORD from the environment
ENV BASIL_ADMIN_PASSWORD=
EXPOSE ${BASIL_API_PORT}
CMD echo "BASIL_API_PORT: ${BASIL_API_PORT}" && cd api && \
gunicorn \
--timeout 120 \
--access-logfile /var/tmp/gunicorn-access.log \
--error-logfile /var/tmp/gunicorn-error.log \
--bind 0.0.0.0:${BASIL_API_PORT} api:app 2>&1 | tee /var/tmp/basil-api-error.log