Add docker-compoose support, using docker-compose run application
This commit is contained in:
parent
94ad020983
commit
f5bc158b14
13
docker-compose.yml
Normal file
13
docker-compose.yml
Normal file
@ -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
|
||||||
|
|
||||||
15
entrypoint.sh
Executable file
15
entrypoint.sh
Executable file
@ -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
|
||||||
Loading…
Reference in New Issue
Block a user