Skip to content

Commit

Permalink
Fix Docker image build step
Browse files Browse the repository at this point in the history
  • Loading branch information
leplatrem committed Jan 30, 2024
1 parent b72a00b commit 7d0b06a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,21 @@ RUN apt-get update && apt-get install -y --no-install-recommends build-essential
ARG KINTO_VERSION=1
ENV SETUPTOOLS_SCM_PRETEND_VERSION_FOR_KINTO=${KINTO_VERSION} \
PATH="/opt/venv/bin:$PATH"
# At this stage we only fetch and build all dependencies.
WORKDIR /pkg-kinto
COPY constraints.txt .
COPY pyproject.toml .
COPY kinto/ kinto/
RUN pip install --upgrade pip && \
pip install -e ".[postgresql,memcached,monitoring]" -c constraints.txt && \
pip install ".[postgresql,memcached,monitoring]" -c constraints.txt && \
pip install kinto-attachment kinto-emailer httpie

FROM python:3.10-slim-bullseye
RUN apt-get update && apt-get install -y --no-install-recommends libpq-dev
RUN groupadd --gid 10001 app && \
useradd --uid 10001 --gid 10001 --home /app --create-home app

WORKDIR /app
USER app

COPY --from=python-builder /opt/venv /opt/venv
COPY . /app
COPY --from=node-builder /kinto/plugins/admin/build ./kinto/plugins/admin/build

ENV KINTO_INI=/etc/kinto/kinto.ini \
Expand All @@ -36,5 +35,8 @@ ENV KINTO_INI=/etc/kinto/kinto.ini \

RUN kinto init --ini $KINTO_INI --host 0.0.0.0 --backend=memory --cache-backend=memory

WORKDIR /app
USER app

# Run database migrations and start the kinto server
CMD kinto migrate --ini $KINTO_INI && kinto start --ini $KINTO_INI --port $PORT
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ kinto = "kinto.__main__:main"
main = "kinto:main"

[tool.setuptools.packages.find]
include = ["kinto"]
include = ["kinto*"]

[tool.setuptools.package-data]
"*" = ["*.tpl", "*.sql", "*.html", "VERSION"]

[tool.setuptools.dynamic]
readme = {file = ["README.rst", "CONTRIBUTORS.rst"]}
Expand Down

0 comments on commit 7d0b06a

Please sign in to comment.