I’m trying to Dockerize my local Django/MySql setup. I have this directory and file structure …
apache docker-compose.yml web - manage.py - venv - requirements.txt - ...
Below is the docker-compose.yml file I’m using …
version: '3' services: web: restart: always build: ./web expose: - "8000" links: - mysql:mysql volumes: - web-django:/usr/src/app - web-static:/usr/src/app/static #env_file: web/venv environment: DEBUG: 'true' command: [ "python", "./web/manage.py runserver 0.0.0.0:8000" ] mysql: restart: always image: mysql:5.7 environment: MYSQL_DATABASE: 'maps_data' # So you don't have to use root, but you can if you like MYSQL_USER: 'chicommons' # You can use whatever password you like MYSQL_PASSWORD: 'password' # Password for root access MYSQL_ROOT_PASSWORD: 'password' ports: - "3406:3406" expose: # Opens port 3406 on the container - '3406' volumes: - my-db:/var/lib/mysql volumes: web-django: web-static: my-db:
However when I run
I get errors like the below
maps_web_1 exited with code 2 web_1 | python: can't open file './web/manage.py runserver 0.0.0.0:8000': [Errno 2] No such file or directory maps_web_1 exited with code 2 maps_web_1 exited with code 2 web_1 | python: can't open file './web/manage.py runserver 0.0.0.0:8000': [Errno 2] No such file or directory maps_web_1 exited with code 2
Is there another way I’m supposed to be referencing the manage.py file?