-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.TINY_IMAGE
48 lines (35 loc) · 1.3 KB
/
Dockerfile.TINY_IMAGE
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
FROM python:3.11-alpine3.19
ARG ENVIRONMENT
ENV ENVIRONMENT=$ENVIRONMENT
ENV DJANGO_SETTINGS_MODULE="project_name.settings"
RUN apk add --update --no-cache git libmagic
# Do you need NumPy and/or pandas?
#RUN apk add py3-numpy=1.25.2-r0 py3-pandas=2.0.3-r0 --repository=https://dl-cdn.alpinelinux.org/alpine/v3.19/community
ENV VIRTUAL_ENV=/usr
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN mkdir -p /data/database
RUN mkdir -p /data/media
RUN mkdir -p /data/static
COPY requirements*.txt /
# NEXUS App Stack (contrib) Python and/or Django dependencies
ENV PYTHONPATH="$PYTHONPATH:\
/nexus-app-stack-contrib/cli/python-utilities:\
/nexus-app-stack-contrib/api/django-common:\
/nexus-app-stack-contrib/api/django-udf-model"
ARG NEXUS_CONTRIB_REPOSITORY_BRANCH
ARG NEXUS_CONTRIB_DOWNLOAD_SCRIPT
# Unavoidable NEXUS App Stack (contrib) magic
RUN export ENVIRONMENT=$ENVIRONMENT BRANCH=$NEXUS_CONTRIB_REPOSITORY_BRANCH && \
sh <(wget -q -O - https://$NEXUS_CONTRIB_DOWNLOAD_SCRIPT || echo false) \
$(echo ${PYTHONPATH//:\/nexus-app-stack-contrib\// })
RUN pip install -r /requirements.txt
COPY app/ /app/
WORKDIR /app
ARG GIT_BRANCH
ARG GIT_VERSION
ARG GIT_LASTCOMMITDATE
ENV GIT_BRANCH=$GIT_BRANCH
ENV GIT_VERSION=$GIT_VERSION
ENV GIT_LASTCOMMITDATE=$GIT_LASTCOMMITDATE
CMD ["/app/entrypoint.sh"]