This repository has been archived by the owner on Dec 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
60 lines (48 loc) · 1.58 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
# Stage: Pulp bindings
# ---------------------------------------------------------
FROM openapitools/openapi-generator-cli AS bindings
COPY bindings/openapi.yaml /local/openapi.yaml
RUN docker-entrypoint.sh generate \
-i /local/openapi.yaml \
-g python \
-o /local/galaxy-pulp \
--skip-validate-spec \
--additional-properties=packageName=galaxy_pulp,projectName=galaxy-pulp
# Stage: Base image
# ---------------------------------------------------------
FROM centos:8 AS base
# # Install missing en_US.UTF-8 locale
RUN dnf install -y \
glibc-langpack-en \
python3 \
&& dnf -y clean all
ENV LANG=en_US.UTF-8
# Stage: galaxy_api image
# ---------------------------------------------------------
FROM base
ENV PYTHONUNBUFFERED=1 \
PULP_SETTINGS=/etc/pulp/settings.py \
DJANGO_SETTINGS_MODULE=pulpcore.app.settings
# Install dependencies
RUN dnf -y install \
gcc \
python3-devel \
libpq \
libpq-devel \
&& dnf -y clean all
COPY . /app
COPY docker/entrypoint.sh /entrypoint
COPY --from=bindings /local/galaxy-pulp /tmp/galaxy-pulp
RUN mkdir -p /var/run/pulp \
/var/lib/pulp/tmp \
&& chmod 755 /entrypoint \
&& python3 -m venv /venv \
&& source /venv/bin/activate \
&& pip install --no-cache --upgrade pip \
&& pip install --no-cache /tmp/galaxy-pulp \
&& pip install --no-cache --editable /app \
&& PULP_CONTENT_ORIGIN=x django-admin collectstatic \
&& rm -rf /tmp/galaxy-pulp
ENV PATH="/venv/bin:${PATH}"
VOLUME [ "/var/lib/pulp/artifact", "/var/lib/pulp/tmp" ]
ENTRYPOINT [ "/entrypoint" ]