Docker local development setup

pull/210/head
bry-c 5 years ago
parent 4c377a073e
commit 9c9c8bc7d9

@ -0,0 +1,21 @@
# use latest python alphine image.
FROM python:rc-alpine3.12
# install system dependencies.
RUN apk update && apk add --no-cache \
gcc libc-dev g++ graphviz git bash go imagemagick inkscape
# install go package.
RUN go get github.com/mingrammer/round
# add go bin to path.
ENV PATH "$PATH:/root/go/bin"
# project directory.
WORKDIR /usr/src/diagrams
# Copy the rest of your app's source code from your host to your image filesystem.
COPY . .
# install python requirements.
RUN pip install -r ./docker/dev/requirements.txt

@ -0,0 +1,2 @@
diagrams
black

@ -0,0 +1,19 @@
Docker local development setup.
1. Go to diagrams project directory.
2. Build the docker image:
docker build --tag diagrams:1.0 -f ./docker/dev/Dockerfile .
3. Run the container in background and mount the project source:
docker run -d \
-it \
--name diagrams \
--mount type=bind,source="$(pwd)",target=/usr/src/diagrams \
diagrams:1.0
4. Run unit tests in the host using the container:
docker exec diagrams python -m unittest tests/*.py -v
5. Run autogen.sh:
docker exec diagrams ./autogen.sh
Loading…
Cancel
Save