mirror of
https://github.com/django/daphne.git
synced 2025-07-27 07:29:46 +03:00
Add Dockerfile and wrapper for docker run
.
Adds a basic Dockerfile. Build with: docker build -t daphne . The `-t daphne` gives the image the name `daphne` so you can run it easily later. Do this once to begin, and if you alter the `venv`. Then you can `docker run` to exectute `pytest`: ``` docker run --rm \ --mount type=bind,source=`pwd`,target=/src \ daphne ``` This mounts the Daphne source code from your checkout into the container, so you can test you latest code, rather than the version you built the container with. In addition the `docker-tests.sh` helper just wraps that `docker run` command, and deletes any .pyc files, so you don’t get a conflict between the host and container.
This commit is contained in:
parent
ffd949f2ce
commit
9cf12f6b37
9
Dockerfile
Normal file
9
Dockerfile
Normal file
|
@ -0,0 +1,9 @@
|
|||
FROM python:3.7
|
||||
|
||||
RUN mkdir /src
|
||||
WORKDIR /src
|
||||
ADD . /src/
|
||||
|
||||
RUN pip install -e .[tests]
|
||||
|
||||
CMD ["pytest"]
|
6
docker-tests.sh
Executable file
6
docker-tests.sh
Executable file
|
@ -0,0 +1,6 @@
|
|||
#! /bin/bash
|
||||
find . -name "*.pyc" -delete
|
||||
|
||||
docker run --rm \
|
||||
--mount type=bind,source=`pwd`,target=/src \
|
||||
daphne
|
Loading…
Reference in New Issue
Block a user