Try   HackMD

Setting up a Docker Dev Environment for the Python Project Starter

  1. Install Remote-Containers VSCode extension. This will alllow you to connect to your docker dev environment through VSCode.

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More β†’

  2. Open up your command pallete(command + shit + p on mac and ctrl + shift + p on windows) and type in Remote-Containers: Add Development Container Configuration Files...

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More β†’

  3. Click From a predefined container configuration definition...

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More β†’

  4. Click Python3 & Postgresql

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More β†’

  5. Update: .devcontainer/devcontainer.json

    From:
    ​​​​// Use 'forwardPorts' to make a list of ports inside the container available locally. ​​​​// "forwardPorts": [5000, 5432], ​​​​// Use 'postCreateCommand' to run commands after the container is created. ​​​​// "postCreateCommand": "pip install --user -r requirements.txt",
    To:
    ​​​​// Use 'forwardPorts' to make a list of ports inside the container available locally. ​​​​"forwardPorts": [5000, 5432, 3000], ​​​​// Use 'postCreateCommand' to run commands after the container is created. ​​​​"postCreateCommand": "pip install --user -r requirements.txt && pip install --user -r dev-requirements.txt",
  6. Update: .devcontainer/docker-compose.yml

    From:
    ​​​​# [Choice] Python version: 3, 3.8, 3.7, 3.6 ​​​​VARIANT: 3
    To:
    ​​​​# [Choice] Python version: 3, 3.8, 3.7, 3.6 ​​​​VARIANT: 3.9
  7. Update: .env DATABASE_URL to

    ​​​​DATABASE_URL=postgresql://postgres:postgres@db