mirror of
https://github.com/krateng/maloja.git
synced 2025-04-12 23:17:13 +03:00
Simplified container build
This commit is contained in:
parent
029d0464b4
commit
d81f8374c9
@ -6,7 +6,7 @@ FROM alpine:3.15
|
|||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
# Install run dependencies first
|
# Install run dependencies first
|
||||||
RUN apk add --no-cache python3 tzdata
|
RUN apk add --no-cache python3 py3-lxml tzdata
|
||||||
|
|
||||||
# system pip could be removed after build, but apk then decides to also remove all its
|
# system pip could be removed after build, but apk then decides to also remove all its
|
||||||
# python dependencies, even if they are explicitly installed as python packages
|
# python dependencies, even if they are explicitly installed as python packages
|
||||||
@ -15,16 +15,7 @@ RUN \
|
|||||||
apk add py3-pip && \
|
apk add py3-pip && \
|
||||||
pip install wheel
|
pip install wheel
|
||||||
|
|
||||||
# these are more static than the real requirements, which means caching
|
|
||||||
COPY ./requirements_pre.txt ./requirements_pre.txt
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
apk add --no-cache --virtual .build-deps gcc g++ python3-dev libxml2-dev libxslt-dev libffi-dev libc-dev py3-pip linux-headers && \
|
|
||||||
pip install --no-cache-dir -r requirements_pre.txt && \
|
|
||||||
apk del .build-deps
|
|
||||||
|
|
||||||
|
|
||||||
# less likely to be cached
|
|
||||||
COPY ./requirements.txt ./requirements.txt
|
COPY ./requirements.txt ./requirements.txt
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
@ -39,10 +30,9 @@ COPY . .
|
|||||||
|
|
||||||
RUN pip install /usr/src/app
|
RUN pip install /usr/src/app
|
||||||
|
|
||||||
# Docker-specific configuration
|
# Docker-specific configuration and default to IPv4
|
||||||
# defaulting to IPv4 is no longer necessary (default host is dual stack)
|
|
||||||
ENV MALOJA_SKIP_SETUP=yes
|
ENV MALOJA_SKIP_SETUP=yes
|
||||||
ENV PYTHONUNBUFFERED=1
|
ENV MALOJA_HOST=0.0.0.0
|
||||||
|
|
||||||
EXPOSE 42010
|
EXPOSE 42010
|
||||||
# use exec form for better signal handling https://docs.docker.com/engine/reference/builder/#entrypoint
|
# use exec form for better signal handling https://docs.docker.com/engine/reference/builder/#entrypoint
|
||||||
|
@ -15,16 +15,7 @@ RUN \
|
|||||||
apk add py3-pip && \
|
apk add py3-pip && \
|
||||||
pip install wheel
|
pip install wheel
|
||||||
|
|
||||||
# these are more static than the real requirements, which means caching
|
|
||||||
COPY ./requirements_pre.txt ./requirements_pre.txt
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
apk add --no-cache --virtual .build-deps {{ tool.osreqs.alpine.build | join(' ') }} && \
|
|
||||||
pip install --no-cache-dir -r requirements_pre.txt && \
|
|
||||||
apk del .build-deps
|
|
||||||
|
|
||||||
|
|
||||||
# less likely to be cached
|
|
||||||
COPY ./requirements.txt ./requirements.txt
|
COPY ./requirements.txt ./requirements.txt
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
|
@ -11,6 +11,7 @@ apk add \
|
|||||||
py3-pip \
|
py3-pip \
|
||||||
linux-headers \
|
linux-headers \
|
||||||
python3 \
|
python3 \
|
||||||
|
py3-lxml \
|
||||||
tzdata \
|
tzdata \
|
||||||
vips
|
vips
|
||||||
|
|
||||||
|
@ -11,5 +11,6 @@ apk add \
|
|||||||
py3-pip \
|
py3-pip \
|
||||||
linux-headers \
|
linux-headers \
|
||||||
python3 \
|
python3 \
|
||||||
|
py3-lxml \
|
||||||
tzdata \
|
tzdata \
|
||||||
vips
|
vips
|
||||||
|
@ -63,6 +63,7 @@ build =[
|
|||||||
]
|
]
|
||||||
run = [
|
run = [
|
||||||
"python3",
|
"python3",
|
||||||
|
"py3-lxml",
|
||||||
"tzdata"
|
"tzdata"
|
||||||
]
|
]
|
||||||
opt = [
|
opt = [
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
# this is a more static file that enables container images to be cached
|
|
||||||
# it should contain packages that take long to build and don't change frequently
|
|
||||||
lxml
|
|
Loading…
x
Reference in New Issue
Block a user