Using Devcontainer

The Municipio deployment repository contains configuration files for Dev Containers to enable a short path to getting a local development environment up and running.

The steps below should get you up and running a local site in a local environment:

Prerequisites

The following tools needs to be installed.

Steps to setup

    1. Clone repo: git clone git@github.com:municipio-se/municipio-deployment.git
    2. Open repo in VS Code.
    3. Copy .devcontainer/.env.example to .devcontainer/.env and set the empty vairables.
    4. Open the command palette and run command: Devcontainers: Rebuild and Reopen in Container
    5. Open the terminal in VS Code.
    6. Run the following command: composer install --prefer-source.
      This will install WordPress along with all plugins listed in composer.json.
    7. When the command above is done, open the VS Code command palette and select Tasks: Run Task, then select the task setup:local site.
      This will run a number of tasks that seeds the database, sets up plugins and so on. For a complete overview of what actions are carried out, check out the ./vscode/tasks.json file.
    8. Run the following command from the VS Code terminal: php build.php.
      This step takes quite a while to perform.
    9. Setup should now be done and you should be able to access your site. A link to the local site should be available under the “ports” tab.

Did this article help you?