diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..f23607b --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +# docker run --rm -v $(pwd):/code -w /code -u $(id -u) -it python:3.10 bash + +version: "3.8" + +services: + application: + image: python:3.10 + volumes: + - .:/code + working_dir: /code + entrypoint: /code/entrypoint.sh + tty: true + diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..113080c --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -e + +if [ ! -e env/bin/activate ] +then + python -m venv env +fi + +if [ "$#" -gt 0 ] +then + bash --rcfile <(cat env/bin/activate) -c -- "$@" +else + bash --rcfile <(cat env/bin/activate) +fi