Skip to content

Commit

Permalink
Docker: Add commands for managing/interacting w/ docker in dev mode
Browse files Browse the repository at this point in the history
scripts/docker-dev/up: starts a dev container.
scripts/docker-dev/down: stops a currently running dev container.
scripts/docker-dev/shell: attaches the tty to a running dev container
and allows interacting with the `mailpile` python cli.
  • Loading branch information
Gregory Igelmund committed Mar 23, 2017
1 parent 2a79283 commit 5ec6e42
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ RUN pip install -r requirements-dev.txt

RUN chmod +x /entrypoint.sh

CMD ["./mp", "--www=0.0.0.0:33411", "--wait"]
CMD ["./mp"]
2 changes: 2 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
version: '3.0'
services:
mailpile_dev:
tty: true
stdin_open: true
container_name: mailpile_dev
build:
context: .
Expand Down
2 changes: 2 additions & 0 deletions scripts/docker-dev/down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
docker-compose -f docker-compose.dev.yml down
9 changes: 9 additions & 0 deletions scripts/docker-dev/shell
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
CONTAINER_NAME=mailpile_dev
CONTAINER_ID=$(docker ps --filter "name=${CONTAINER_NAME}" --quiet)
if [[ ! -z $CONTAINER_ID ]]; then
echo "Connecting to docker container ${CONTAINER_NAME}:${CONTAINER_ID}"
docker attach $CONTAINER_NAME
else
echo "Docker container ${CONTAINER_NAME} does not seem to be running. Start it with './scripts/docker-dev/up'"
fi
2 changes: 2 additions & 0 deletions scripts/docker-dev/up
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
docker-compose -f docker-compose.dev.yml up --build --remove-orphans

0 comments on commit 5ec6e42

Please sign in to comment.