mirror of https://github.com/langgenius/dify.git
improve api docker file and lock Debian version in base image tag (#2195)
This commit is contained in:
parent
d5361b8d09
commit
8639abec97
|
@ -1,8 +1,11 @@
|
||||||
# packages install stage
|
# base image
|
||||||
FROM python:3.10-slim AS base
|
FROM python:3.10-slim-bookworm AS base
|
||||||
|
|
||||||
LABEL maintainer="takatost@gmail.com"
|
LABEL maintainer="takatost@gmail.com"
|
||||||
|
|
||||||
|
# install packages
|
||||||
|
FROM base as packages
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends gcc g++ python3-dev libc-dev libffi-dev
|
&& apt-get install -y --no-install-recommends gcc g++ python3-dev libc-dev libffi-dev
|
||||||
|
|
||||||
|
@ -10,9 +13,8 @@ COPY requirements.txt /requirements.txt
|
||||||
|
|
||||||
RUN pip install --prefix=/pkg -r requirements.txt
|
RUN pip install --prefix=/pkg -r requirements.txt
|
||||||
|
|
||||||
# build stage
|
# production stage
|
||||||
FROM python:3.10-slim AS builder
|
FROM base AS production
|
||||||
|
|
||||||
|
|
||||||
ENV FLASK_APP app.py
|
ENV FLASK_APP app.py
|
||||||
ENV EDITION SELF_HOSTED
|
ENV EDITION SELF_HOSTED
|
||||||
|
@ -30,11 +32,11 @@ ENV TZ UTC
|
||||||
WORKDIR /app/api
|
WORKDIR /app/api
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends bash curl wget vim nodejs ffmpeg \
|
&& apt-get install -y --no-install-recommends curl wget vim nodejs ffmpeg \
|
||||||
&& apt-get autoremove \
|
&& apt-get autoremove \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY --from=base /pkg /usr/local
|
COPY --from=packages /pkg /usr/local
|
||||||
COPY . /app/api/
|
COPY . /app/api/
|
||||||
|
|
||||||
COPY docker/entrypoint.sh /entrypoint.sh
|
COPY docker/entrypoint.sh /entrypoint.sh
|
||||||
|
|
Loading…
Reference in New Issue