You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
941 B

  1. services:
  2. python-someproject:
  3. user: ${WORKSPACE_PUID}:${WORKSPACE_PGID}
  4. build:
  5. context: ${PYTHON_PROJECTS_DIR}/someproject
  6. args:
  7. - PUID=${WORKSPACE_PUID}
  8. - PGID=${WORKSPACE_PGID}
  9. - PYTHON_VERSION=3.9.20
  10. volumes:
  11. - ${PYTHON_PROJECTS_DIR}/someproject:/app
  12. command: bash --init-file /venv/bin/activate -c "
  13. python manage.py migrate
  14. && python manage.py collectstatic
  15. && uvicorn 'APP_NAME.asgi:application' --host 0.0.0.0
  16. "
  17. python-project:
  18. user: ${WORKSPACE_PUID}:${WORKSPACE_PGID}
  19. restart: always
  20. build:
  21. context: ${PYTHON_PROJECTS_DIR}/project
  22. volumes:
  23. - ${PYTHON_PROJECTS_DIR}/project:/code
  24. command: bash -c "
  25. cd src
  26. && python manage.py compilemessages
  27. && python manage.py collectstatic --clear --noinput
  28. && python manage.py migrate
  29. && uvicorn --reload app.asgi:application --host 0.0.0.0
  30. "