File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash -xe
2- CONTAINER=" ${USER} _pycontw_vm "
2+ CONTAINER=" pycontw "
33COMPOSE_FILE=" ./docker-compose-dev.yml"
44
55# test if the container is running
1414
1515if [ -n " $HASH " ]; then
1616 echo " found existing running container $CONTAINER , proceeding to exec another shell"
17- docker-compose -f $COMPOSE_FILE restart
18- docker exec -w /app/src -it $HASH bash -c " SHELL=bash poetry shell"
17+ docker-compose -f $COMPOSE_FILE exec -i $CONTAINER bash -c " SHELL=bash source /app/.venv/bin/activate && bash"
1918elif [ -n " $HASH_STOPPED " ]; then
2019 echo " found existing stopped container $CONTAINER , starting"
21- docker-compose -f $COMPOSE_FILE restart
22- docker start --attach -i $HASH_STOPPED
20+ ( docker-compose -f $COMPOSE_FILE restart && docker start $HASH_STOPPED ) > /dev/null 2>&1
21+ docker-compose -f $COMPOSE_FILE exec -i $CONTAINER bash -c " SHELL=bash source /app/.venv/bin/activate && bash "
2322else
2423 echo " existing container not found, creating a new one, named $CONTAINER "
25- docker-compose -f $COMPOSE_FILE pull
26- docker-compose -f $COMPOSE_FILE run -p 8000:8000 --name= $CONTAINER pycontw bash -c " SHELL=bash poetry shell "
24+ docker-compose -f $COMPOSE_FILE up --build --remove-orphans -d
25+ docker-compose -f $COMPOSE_FILE exec -i $CONTAINER bash -c " SHELL=bash source /app/.venv/bin/activate && bash "
2726fi
2827echo " see you, use 'docker rm $CONTAINER ' to kill the dev container or 'docker-compose -f $COMPOSE_FILE down' to kill both the postgres and the dev container if you want a fresh env next time"
You can’t perform that action at this time.
0 commit comments