refactor: format api container file
Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2299>
This commit is contained in:
parent
6528039e95
commit
65df7bf7a4
|
@ -4,11 +4,17 @@ FROM alpine:3.17 as pre-build
|
||||||
# dependencies. This is only required until alpine 3.16 is released, since this
|
# dependencies. This is only required until alpine 3.16 is released, since this
|
||||||
# allows us to install poetry as package.
|
# allows us to install poetry as package.
|
||||||
|
|
||||||
RUN apk add --no-cache python3 py3-cryptography py3-pip poetry
|
RUN set -eux; \
|
||||||
COPY pyproject.toml poetry.lock /
|
apk add --no-cache \
|
||||||
RUN poetry export --without-hashes > requirements.txt
|
poetry \
|
||||||
RUN poetry export --with dev --without-hashes > dev-requirements.txt
|
py3-cryptography \
|
||||||
|
py3-pip \
|
||||||
|
python3
|
||||||
|
|
||||||
|
COPY pyproject.toml poetry.lock /
|
||||||
|
RUN set -eux; \
|
||||||
|
poetry export --without-hashes > requirements.txt; \
|
||||||
|
poetry export --without-hashes --with dev > dev-requirements.txt;
|
||||||
|
|
||||||
FROM alpine:3.17 as builder
|
FROM alpine:3.17 as builder
|
||||||
|
|
||||||
|
@ -40,9 +46,8 @@ RUN set -eux; \
|
||||||
py3-watchfiles=0.18.1-r0 \
|
py3-watchfiles=0.18.1-r0 \
|
||||||
python3-dev
|
python3-dev
|
||||||
|
|
||||||
# create virtual env for next stage
|
# Create virtual env
|
||||||
RUN python3 -m venv --system-site-packages /venv
|
RUN python3 -m venv --system-site-packages /venv
|
||||||
# emulate activation by prefixing PATH
|
|
||||||
ENV PATH="/venv/bin:/root/.local/bin:$PATH" VIRTUAL_ENV=/venv
|
ENV PATH="/venv/bin:/root/.local/bin:$PATH" VIRTUAL_ENV=/venv
|
||||||
|
|
||||||
COPY --from=pre-build /requirements.txt /requirements.txt
|
COPY --from=pre-build /requirements.txt /requirements.txt
|
||||||
|
@ -100,7 +105,6 @@ RUN set -eux; \
|
||||||
python3
|
python3
|
||||||
|
|
||||||
COPY --from=builder /venv /venv
|
COPY --from=builder /venv /venv
|
||||||
# emulate activation by prefixing PATH
|
|
||||||
ENV PATH="/venv/bin:$PATH"
|
ENV PATH="/venv/bin:$PATH"
|
||||||
|
|
||||||
COPY . /app
|
COPY . /app
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Format api container file
|
Loading…
Reference in New Issue