mirror of
https://github.com/fastapi-admin/fastapi-admin.git
synced 2026-03-13 10:32:25 +08:00
reduce docker image
This commit is contained in:
15
Dockerfile
15
Dockerfile
@@ -1,12 +1,15 @@
|
||||
FROM jfloff/alpine-python
|
||||
FROM python:3.9 as builder
|
||||
ENV CRYPTOGRAPHY_DONT_BUILD_RUST=1
|
||||
RUN mkdir -p /fastapi-admin
|
||||
WORKDIR /fastapi-admin
|
||||
COPY pyproject.toml poetry.lock /fastapi-admin/
|
||||
RUN pip install --upgrade pip
|
||||
RUN pip3 install poetry
|
||||
ENV POETRY_VIRTUALENVS_CREATE false
|
||||
RUN poetry install --no-root
|
||||
RUN pip install --upgrade pip && pip3 install poetry && poetry install --no-root
|
||||
COPY . /fastapi-admin
|
||||
RUN poetry install
|
||||
RUN make compile
|
||||
RUN poetry install && make compile
|
||||
|
||||
FROM python:3.9-slim
|
||||
WORKDIR /fastapi-admin
|
||||
COPY --from=builder /usr/local/lib/python3.9/site-packages /usr/local/lib/python3.9/site-packages
|
||||
COPY --from=builder /usr/local/bin/ /usr/local/bin/
|
||||
COPY --from=builder /fastapi-admin /fastapi-admin
|
||||
|
||||
Reference in New Issue
Block a user