Commit 4d04569f authored by Raphael Beer's avatar Raphael Beer

Fix: some docker specifics

parent f8897cec
FROM python:3.7-slim-buster FROM python:3.7-slim-buster
RUN apt update
RUN apt install gcc python3-dev -y
RUN mkdir /app RUN mkdir /app
ADD . /app ADD . /app
ENV NO_VENV=1
WORKDIR /app WORKDIR /app
RUN ./bin/install.sh RUN ./bin/install.sh
...@@ -6,10 +6,14 @@ if ! hash python3 &> /dev/null; then ...@@ -6,10 +6,14 @@ if ! hash python3 &> /dev/null; then
fi fi
echo "OK" echo "OK"
if [ ! -f .venv/bin/activate ]; then if [ "$NO_VENV" != "1" ]; then
echo "Creating new venv in: ./.venv" if [ ! -f .venv/bin/activate ]; then
python3 -m venv ./.venv echo "Creating new venv in: ./.venv"
fi python3 -m venv ./.venv
fi
echo "Loading virtualenv: ./.venv" echo "Loading virtualenv: ./.venv"
source ./.venv/bin/activate source ./.venv/bin/activate
else
echo "Skipping venv setup"
fi
#!/usr/bin/env bash #!/usr/bin/env bash
source ./_venv source ./bin/_venv
if [ "$1" != "" ] && [ -f $1 ]; then if [ "$1" != "" ] && [ -f $1 ]; then
echo "Using provided .env file: $1" echo "Using provided .env file: $1"
......
...@@ -8,6 +8,6 @@ pip3 install -r requirements.txt --no-cache-dir ...@@ -8,6 +8,6 @@ pip3 install -r requirements.txt --no-cache-dir
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
echo -e "\n----------------------------" echo -e "\n----------------------------"
echo -e "Almost done! \\o/\n" echo -e "Almost done! \\o/\n"
echo "Run 'PYTHON_ENV=[development|prodcution] ./docker-entry.sh .env.example' to start the server!" echo "Run 'PYTHON_ENV=[development|prodcution] ./bin/docker-entry.sh .env.example' to start the server!"
echo -e "\nIf you want to make changes to the python packages, e.g. 'pip3 install ...', activate the venv, first: '. .venv/bin/activate'" echo -e "\nIf you want to make changes to the python packages, e.g. 'pip3 install ...', activate the venv, first: '. .venv/bin/activate'"
fi fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment