Skip to content

Commit

Permalink
Reapply "docker: Merge Dockerfiles into one again"
Browse files Browse the repository at this point in the history
This reverts commit 57cd3c0.
  • Loading branch information
bbhtt committed Feb 5, 2025
1 parent 64473aa commit c77bafe
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 86 deletions.
48 changes: 0 additions & 48 deletions .github/workflows/backend_base_images.yml

This file was deleted.

36 changes: 30 additions & 6 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,45 @@
FROM ghcr.io/flathub-infra/backend-builder-base:latest AS builder
FROM ubuntu:latest AS builder

COPY pyproject.toml poetry.lock /
RUN apt-get update && apt-get install -y --no-install-recommends software-properties-common \
&& add-apt-repository ppa:flatpak/stable

RUN apt-get update && \
apt-get install -y --no-install-recommends \
python3 python3-dev python3-pip python-is-python3 python3-venv \
build-essential libpq-dev libcairo2-dev libgirepository1.0-dev \
gir1.2-ostree-1.0 gir1.2-appstream-1.0 flatpak

RUN python -m pip install --no-cache-dir --break-system-packages pipx && \
pipx install poetry && \
pipx inject poetry poetry-plugin-export

COPY pyproject.toml poetry.lock /
RUN /root/.local/bin/poetry export -f requirements.txt --output requirements.txt && \
python -m venv /venv && \
/venv/bin/python -m pip install --no-cache-dir -r requirements.txt

FROM ghcr.io/flathub-infra/backend-base:latest
FROM ubuntu:latest
ARG SENTRY_RELEASE
ENV PATH="/venv/bin:$PATH"

EXPOSE 8000
RUN apt-get update && apt-get install -y --no-install-recommends software-properties-common \
&& add-apt-repository ppa:flatpak/stable

RUN apt-get update && \
apt-get install -y --no-install-recommends \
python3 python-is-python3 python3-venv ca-certificates libcairo2 libpq5 \
libgirepository-1.0-1 gir1.2-ostree-1.0 gir1.2-appstream-1.0 flatpak && \
apt-get clean && rm -rf /var/lib/apt/lists/*

RUN flatpak --user remote-add flathub https://flathub.org/repo/flathub.flatpakrepo && \
flatpak --user remote-add flathub-beta https://flathub.org/beta-repo/flathub-beta.flatpakrepo

COPY --from=builder /venv /venv
COPY . /app
WORKDIR /app

ENV SENTRY_RELEASE="$SENTRY_RELEASE"
ENV PATH="/venv/bin:$PATH" \
SENTRY_RELEASE="$SENTRY_RELEASE"

EXPOSE 8000

CMD ["/app/docker-entrypoint.sh"]
13 changes: 0 additions & 13 deletions backend/Dockerfile.base

This file was deleted.

19 changes: 0 additions & 19 deletions backend/Dockerfile.builder-base

This file was deleted.

0 comments on commit c77bafe

Please sign in to comment.