-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (29 loc) · 1019 Bytes
/
Dockerfile
File metadata and controls
38 lines (29 loc) · 1019 Bytes
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
# Use the UBI minimal base image
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
LABEL name="incluster-anomaly" \
description="Anomaly detection docker file" \
target-file="Dockerfile"
# Set environment variables
ENV PYTHON_VERSION=3.9 \
PATH=$HOME/.local/bin/:$PATH \
PYTHONUNBUFFERED=1 \
PYTHONIOENCODING=UTF-8 \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8
# Install Python 3.9
RUN microdnf update -y && \
microdnf install -y python39 && \
microdnf -y clean all && rm -rf /var/cache/yum
# Install pipenv and setuptools
RUN pip3.9 install --no-cache-dir --upgrade pip && \
pip3.9 install --no-cache-dir --upgrade pipenv && \
pip3.9 install --no-cache-dir 'setuptools>=65.5.1'
# Setup work directory
WORKDIR /opt/app-root/
# Copy files to workdir
COPY ./Pipfile* /opt/app-root/
# Install pipenv
RUN PIPENV_VENV_IN_PROJECT=1 PIPENV_IGNORE_VIRTUALENVS=1 pipenv install --system --deploy --ignore-pipfile
COPY src /opt/app-root/src
# drop root privilege
USER 1001