forked from quipucords/quipucords
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
64 lines (48 loc) · 1.34 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
61
62
63
64
FROM redhat/ubi8
ENV DJANGO_DB_PATH=/var/data/
ENV DJANGO_DEBUG=False
ENV DJANGO_LOG_FILE=/var/log/app.log
ENV DJANGO_LOG_FORMATTER=verbose
ENV DJANGO_LOG_HANDLERS=console,file
ENV DJANGO_LOG_LEVEL=INFO
ENV DJANGO_SECRET_PATH=/var/data/secret.txt
ENV LANG=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
ENV PATH="/opt/venv/bin:${PATH}"
ENV PRODUCTION=True
ENV PYTHONPATH=/app/quipucords
ENV QUIPUCORDS_LOG_LEVEL=INFO
RUN dnf -yq install python39 make openssh-clients glibc-langpack-en git &&\
dnf clean all &&\
python3 -m venv /opt/venv
RUN pip install --upgrade pip wheel
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
# Fetch UI code
COPY Makefile .
ARG UI_RELEASE=0.9.3
RUN make fetch-ui -e QUIPUCORDS_UI_RELEASE=${UI_RELEASE}
# Create /etc/ssl/qpc
COPY deploy/ssl/* /etc/ssl/qpc/
# Create /deploy
COPY deploy/* /deploy/
# Create log directories
VOLUME /var/log
# Create /var/data
VOLUME /var/data
# Create /etc/ansible/roles/
RUN mkdir -p /etc/ansible/roles/
COPY quipucords/scanner/network/runner/roles/ /etc/ansible/roles/
VOLUME /etc/ansible/roles/
# Set production environment
ARG BUILD_COMMIT=master
ENV QUIPUCORDS_COMMIT=$BUILD_COMMIT
# Copy server code
COPY . .
# Install quipucords as package
RUN pip install -v -e .
# Collect static files
RUN make server-static
EXPOSE 443
CMD ["/bin/bash", "/deploy/docker_run.sh"]