forked from RedHatInsights/vulnerability-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.test
41 lines (30 loc) · 1.39 KB
/
Dockerfile.test
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
FROM registry.access.redhat.com/ubi9/ubi-minimal
RUN curl -o /etc/yum.repos.d/mmraka-postgresql-15-epel-9.repo https://copr.fedorainfracloud.org/coprs/mmraka/postgresql-15/repo/epel-9/mmraka-postgresql-15-epel-9.repo
RUN microdnf install -y --setopt=install_weak_deps=0 --setopt=tsflags=nodocs \
python311 python3.11-pip python3.11-devel libpq-devel gcc git postgresql-server which findutils diffutils && \
microdnf clean all
# missing pg_config, gcc, python3-devel needed for psycopg on aarch64
RUN [ "$(uname -m)" == "aarch64" ] && \
microdnf install -y --setopt=install_weak_deps=0 --setopt=tsflags=nodocs \
gcc-c++ && \
microdnf clean all || true
# for testing.posgres python package to find postgres commands
RUN ln -s /usr/bin/initdb /usr/local/bin/initdb && \
ln -s /usr/bin/postgres /usr/local/bin/postgres
RUN mkdir /engine && \
chown -R postgres:postgres /engine
WORKDIR /engine
ADD pyproject.toml /engine/
ADD poetry.lock /engine/
ENV LC_ALL=C.utf8
ENV LANG=C.utf8
RUN pip3.11 install --upgrade pip && \
pip3.11 install --upgrade poetry~=1.5
RUN poetry export --with dev -f requirements.txt --output requirements.txt && \
pip3.11 install -r requirements.txt
ADD . /engine
RUN chown -R postgres:postgres /engine
USER postgres
# config git, required by "test_upgrade"
RUN git config --global user.email "test@test" && \
git config --global user.name "test"