-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathDockerfile.test
43 lines (31 loc) · 1.41 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
42
43
FROM registry.access.redhat.com/ubi9/ubi-minimal
RUN curl -o /etc/yum.repos.d/postgresql.repo \
https://copr.fedorainfracloud.org/coprs/g/insights/postgresql-16/repo/epel-9/group_insights-postgresql-16-epel-9.repo
RUN microdnf install -y --setopt=install_weak_deps=0 --setopt=tsflags=nodocs \
python312 python3.12-pip python3.12-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.12 install --upgrade pip && \
pip3.12 install --upgrade poetry~=2.0 poetry-plugin-export
RUN poetry export --with dev -f requirements.txt --output requirements.txt && \
pip3.12 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"