
# file: docker-compose.yml

~~~yml
version: "3"
name: transporte-cms

services:
  app:
    image: python:3.11-alpine
    restart: unless-stopped
    volumes:
      - ../:/app
      - venv:/root/.local
    working_dir: /app
    environment:
      PORT: 8000
    command: sh -c "
      export PYTHONUSERBASE=/root/.local ;
      [ -d /root/.local/bin ] || (pip install --user -r ./myproject/requirements.txt) ;
      [ -d ./myproject ] || (django-admin startproject myproject) ;
      chmod o+w -R myproject/ ;
      [ -f .env ] || ([ -f .env.develop ] && cp .env.develop .env) ;
      python myproject/manage.py runserver 0.0.0.0:$PORT
      "

networks:
  default:
    external:
      name: transporte_default

volumes:
  venv:
~~~


