Skip to content

Commit

Permalink
docker: reorganize develop image and use wdb for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
em92 committed Aug 19, 2024
1 parent fd01a3a commit 087b73f
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
43 changes: 43 additions & 0 deletions Dockerfile.develop
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM registry.altlinux.org/alt/base:p10

RUN apt-get update && apt-get install -y \
python3-module-async-timeout \
python3-module-asyncpg \
python3-module-cachetools \
python3-module-jinja2 \
python3-module-pip \
python3-module-psycopg2 \
python3-module-requests \
python3-module-starlette \
python3-module-uvicorn \
&& find /var/lib/apt/lists/ -type f -delete

RUN apt-get update && apt-get install -y \
gcc make \
git \
postgresql15-server \
python3-modules-sqlite3 \
&& find /var/lib/apt/lists/ -type f -delete

RUN git clone https://github.com/eradman/ephemeralpg.git \
&& cd ephemeralpg \
&& make && make install \
&& cd .. \
&& rm -rf ephemeralpg/

RUN python3 -m pip install wdb

ENV PATH="/usr/lib/postgresql/15/bin:${PATH}"
# take out coverage report from source directory
ENV COVERAGE_FILE="/tmp/qllr.coverage"

COPY --chown=apache . /opt/qllr

WORKDIR /opt/qllr

RUN python3 -m pip install --no-deps -r requirements.txt
RUN python3 -m pip install -r requirements_dev.txt

USER apache

CMD ["sh", "-c", "./docker/entrypoint.py && ./main.py"]
14 changes: 13 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,20 @@ services:
dev:
build:
context: .
dockerfile: Dockerfile.develop.buster
dockerfile: Dockerfile.develop
volumes:
- .:/opt/qllr
ports:
- "127.0.0.1:7081:8000"
environment:
- DATABASE_URL=postgres://eugene:bebebe@db:5432/qllr
- HOST=0.0.0.0
- PORT=8000
- WDB_SOCKET_SERVER=wdb
- WDB_NO_BROWSER_AUTO_OPEN=True
depends_on: ["wdb", "db"]

wdb:
image: kozea/wdb:3.3.0
ports:
- "127.0.0.1:1984:1984"

0 comments on commit 087b73f

Please sign in to comment.