forked from RedHatInsights/insights-rbac
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
73 lines (58 loc) · 2.23 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
65
66
67
68
69
70
71
72
73
FROM registry.access.redhat.com/ubi8/python-36
EXPOSE 8080
ENV NODEJS_VERSION=14 \
NODEJS_SCL=rh-nodejs14 \
NPM_RUN=start \
NODEJS_SCL=rh-nodejs14 \
NPM_CONFIG_PREFIX=$HOME/.npm-global \
PATH=$HOME/.local/bin/:$HOME/node_modules/.bin/:$HOME/.npm-global/bin/:$PATH \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8 \
PIP_NO_CACHE_DIR=off \
UPGRADE_PIP_TO_LATEST=true \
PIP_INDEX_URL="" \
PIPENV_PYPI_MIRROR="" \
ENABLE_PIPENV=true \
APP_CONFIG=/opt/app-root/src/rbac/gunicorn.py \
APP_HOME=/opt/app-root/src/rbac \
APP_MODULE=rbac.wsgi \
APP_NAMESPACE=rbac
ENV SUMMARY="Insights RBAC is a role based access control web server" \
DESCRIPTION="Insights RBAC is a role based access control web server"
LABEL summary="$SUMMARY" \
description="$DESCRIPTION" \
io.k8s.description="$DESCRIPTION" \
io.k8s.display-name="insights-rbac" \
io.openshift.expose-services="8080:http" \
io.openshift.tags="python,python36,rh-python36" \
com.redhat.component="python36-docker" \
name="insights-rbac" \
version="1" \
maintainer="Red Hat Insights"
USER root
RUN yum module reset nodejs -y
RUN yum install @nodejs:14 -y
# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH.
COPY openshift/s2i/bin $STI_SCRIPTS_PATH
# Copy extra files to the image.
COPY openshift/root /
# Copy application files to the image.
COPY . ${APP_ROOT}/src
# - Create a Python virtual environment for use by any application to avoid
# potential conflicts with Python packages preinstalled in the main Python
# installation.
# - In order to drop the root user, we have to make some directories world
# writable as OpenShift default security model is to run the container
# under random UID.
RUN virtualenv ${APP_ROOT} && \
chown -R 1001:0 ${APP_ROOT} && \
fix-permissions ${APP_ROOT} -P && \
rpm-file-permissions && \
$STI_SCRIPTS_PATH/assemble || true
RUN curl -L -o /usr/bin/haberdasher \
https://github.com/RedHatInsights/haberdasher/releases/latest/download/haberdasher_linux_amd64 && \
chmod 755 /usr/bin/haberdasher
USER 1001
ENTRYPOINT ["/usr/bin/haberdasher"]
# Set the default CMD to print the usage of the language image.
CMD $STI_SCRIPTS_PATH/run