forked from external-repos/ivatar-docker
[from now] 2022/02/05 18:35:35
diff --git a/Dockerfile b/Dockerfile index 38bbf73..452f6ff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,20 @@ -FROM python:latest +FROM python:alpine + +WORKDIR /ivatar + +RUN apk add --no-cache --virtual build-deps build-base gcc python2-dev python3-dev musl-dev git && \ + apk add --no-cache jpeg-dev openldap-dev libffi-dev mariadb-dev zlib-dev +RUN echo 'INPUT ( libldap.so )' > /usr/lib/libldap_r.so + +RUN pip install --upgrade pip setuptools==57.5.0 +RUN pip install 2to3 pillow -WORKDIR /opt/venv RUN git clone https://git.linux-kernel.at/oliver/ivatar.git . +RUN pip install -r requirements.txt -ENV VIRTUAL_ENV=/opt/venv -RUN python3 -m venv $VIRTUAL_ENV -ENV PATH="$VIRTUAL_ENV/bin:$PATH" +RUN apk del build-deps && pip cache purge -RUN /opt/venv/bin/python3 -m pip install --upgrade pip -RUN pip install pillow && pip install -r requirements.txt +COPY entrypoint.sh . -CMD ["python", "manage.py runserver 0:8080"] +EXPOSE 8080 +CMD ["/bin/ash", "entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..4befdea --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/ash + +python ./manage.py migrate +python ./manage.py runserver 0:8080 \ No newline at end of file
This commit is contained in:
23
Dockerfile
23
Dockerfile
@@ -1,13 +1,20 @@
|
|||||||
FROM python:latest
|
FROM python:alpine
|
||||||
|
|
||||||
|
WORKDIR /ivatar
|
||||||
|
|
||||||
|
RUN apk add --no-cache --virtual build-deps build-base gcc python2-dev python3-dev musl-dev git && \
|
||||||
|
apk add --no-cache jpeg-dev openldap-dev libffi-dev mariadb-dev zlib-dev
|
||||||
|
RUN echo 'INPUT ( libldap.so )' > /usr/lib/libldap_r.so
|
||||||
|
|
||||||
|
RUN pip install --upgrade pip setuptools==57.5.0
|
||||||
|
RUN pip install 2to3 pillow
|
||||||
|
|
||||||
WORKDIR /opt/venv
|
|
||||||
RUN git clone https://git.linux-kernel.at/oliver/ivatar.git .
|
RUN git clone https://git.linux-kernel.at/oliver/ivatar.git .
|
||||||
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
ENV VIRTUAL_ENV=/opt/venv
|
RUN apk del build-deps && pip cache purge
|
||||||
RUN python3 -m venv $VIRTUAL_ENV
|
|
||||||
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
|
||||||
|
|
||||||
RUN /opt/venv/bin/python3 -m pip install --upgrade pip
|
COPY entrypoint.sh .
|
||||||
RUN pip install pillow && pip install -r requirements.txt
|
|
||||||
|
|
||||||
CMD ["python", "manage.py runserver 0:8080"]
|
EXPOSE 8080
|
||||||
|
CMD ["/bin/ash", "entrypoint.sh"]
|
||||||
|
|||||||
4
entrypoint.sh
Normal file
4
entrypoint.sh
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/ash
|
||||||
|
|
||||||
|
python ./manage.py migrate
|
||||||
|
python ./manage.py runserver 0:8080
|
||||||
Reference in New Issue
Block a user