Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker local development setup #210

Merged
merged 3 commits into from
Jul 1, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions docker/dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions docker/dev/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
diagrams
black
bry-c marked this conversation as resolved.
Show resolved Hide resolved
19 changes: 19 additions & 0 deletions docker/dev/setup.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Docker local development setup.
bry-c marked this conversation as resolved.
Show resolved Hide resolved

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