-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathDockerfile
More file actions
85 lines (65 loc) · 2.21 KB
/
Dockerfile
File metadata and controls
85 lines (65 loc) · 2.21 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
FROM golang:1.23 AS go_builder
COPY ./go /code
WORKDIR /code
RUN sh -c "make"
FROM node:20.9.0-alpine AS ui_builder
ARG ADCM_VERSION
ENV ADCM_VERSION=$ADCM_VERSION
COPY ./adcm-web/app /code
WORKDIR /code
RUN . build.sh
FROM python:3.10-alpine AS python_builder
ENV PYTHONBUFFERED=1
ENV POETRY_VERSION=1.8.3
ENV POETRY_HOME=/opt/poetry
ENV POETRY_VENV=/opt/poetry-venv
ENV POETRY_CACHE_DIR=/opt/poetry-cache
ENV POETRY_VIRTUALENVS_CREATE=0
RUN apk update && \
apk upgrade && \
apk add --no-cache build-base linux-headers openldap-dev
COPY poetry.lock pyproject.toml /adcm/
RUN python -m venv $POETRY_VENV && \
$POETRY_VENV/bin/pip install --no-cache-dir poetry==$POETRY_VERSION && \
$POETRY_VENV/bin/poetry --no-cache --directory=/adcm install --no-root --with ansible,run
FROM python:3.10-alpine
RUN apk update && \
apk upgrade && \
apk add --no-cache \
bash \
gnupg \
nginx \
openldap \
openssh-client \
openssh-keygen \
openssl \
rsync \
runit \
sshpass && \
apk cache clean --purge
RUN python -m pip install -U setuptools && \
python -m pip uninstall -y pip && \
rm -rf /root/.cache/pip
RUN ln -s /usr/local/bin/python3 /usr/bin/python3 && \
ln -s /usr/bin/python3 /usr/bin/python
COPY os/etc /etc
COPY os/etc/crontabs/root /var/spool/cron/crontabs/root
COPY --from=go_builder /code/bin/runstatus /adcm/go/bin/runstatus
COPY --from=ui_builder /wwwroot /adcm/wwwroot
COPY --from=python_builder /usr/local/bin /usr/local/bin
COPY --from=python_builder /usr/local/lib/python3.10 /usr/local/lib/python3.10
COPY --from=arenadata/ansible:2.9.27-python3.10 /venv/2.9 /venv/2.9
COPY --from=arenadata/ansible:2.16.4-python3.10 /venv/2.16 /venv/2.16
COPY --from=arenadata/ansible:2.16.4-python3.10 /root/.ansible/collections /root/.ansible/collections
COPY conf /adcm/conf
COPY python/ansible_share/plugins /usr/share/ansible/plugins
COPY python /adcm/python
RUN python -m pip uninstall -y pip && \
rm -rf /root/.cache/pip
RUN mkdir -p /adcm/data/log
RUN DJANGO_SETTINGS_MODULE=adcm.settings.build python /adcm/python/manage.py collectstatic --noinput
ENV PYTHONPATH=/adcm/python
ARG ADCM_VERSION
ENV ADCM_VERSION=$ADCM_VERSION
EXPOSE 8000
CMD ["/etc/startup.sh"]