-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathContainerfile-api-fedora
More file actions
71 lines (59 loc) · 1.72 KB
/
Copy pathContainerfile-api-fedora
File metadata and controls
71 lines (59 loc) · 1.72 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
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
FROM registry.fedoraproject.org/fedora:39
USER root
RUN mkdir BASIL-API
WORKDIR /BASIL-API
ARG PANDOC_TMPDIR=/tmp/pandoc/workdir
# Install dependencies
RUN dnf install -y curl git graphviz jq patch python3 python3-pip python3-virtualenv podman rsync
# Install Pandoc dependencies
RUN mkdir -p ${PANDOC_TMPDIR} \
&& chmod a+rw ${PANDOC_TMPDIR}
RUN dnf -y install \
pandoc \
wkhtmltopdf \
fontconfig \
google-roboto-fonts \
pango \
xorg-x11-fonts-Type1 \
xorg-x11-fonts-75dpi \
xorg-x11-fonts-100dpi \
libXrender \
libXext \
libX11 \
libstdc++ \
ca-certificates \
&& dnf clean all
COPY . .
RUN virtualenv penv && \
. penv/bin/activate && \
pip3 install --no-cache-dir -r requirements.txt
ARG API_PORT=5000
ARG ADMIN_PASSWORD=admin
ARG TESTING=0
ARG DB_PORT=5432
ARG DB_PASSWORD=password
ENV BASIL_ADMIN_PASSWORD=${ADMIN_PASSWORD} \
BASIL_API_PORT=${API_PORT} \
BASIL_TESTING=${TESTING} \
BASIL_DB_PORT=${DB_PORT} \
BASIL_DB_PASSWORD=${DB_PASSWORD} \
BASIL_PANDOC_TMPDIR=${PANDOC_TMPDIR}
# Create directories
RUN mkdir -p /var/tmp && \
mkdir -p /BASIL-API/api/user-files
# Init the database and
# Write permission to db
RUN chmod a+rw /BASIL-API/db
# Apply patches
RUN patch -u /BASIL-API/penv/lib/python3.12/site-packages/tmt/steps/provision/podman.py < /BASIL-API/misc/tmt_provision_podman.patch && \
. /BASIL-API/penv/bin/activate && tmt init
EXPOSE ${BASIL_API_PORT}
CMD echo "BASIL_API_PORT: ${BASIL_API_PORT}" && \
. /BASIL-API/penv/bin/activate && \
cd api && \
BASIL_TESTING=${BASIL_TESTING} gunicorn \
--timeout 120 \
--workers 4 \
--access-logfile - \
--error-logfile - \
--bind 0.0.0.0:${BASIL_API_PORT} api:app