Go to file
Francisco Sandoval 99206a13bb commit inicial 2023-12-09 17:24:36 -03:00
myproject commit inicial 2023-12-09 17:24:36 -03:00
.env.develop commit inicial 2023-12-09 17:24:36 -03:00
.gitignore commit inicial 2023-12-09 17:24:36 -03:00
readme.md commit inicial 2023-12-09 17:24:36 -03:00

readme.md

file: docker-compose.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: