When using a DevContainer, the opam
packages and database files are mounted as volumes into the DevContainer.
- Docker volume
db-root
: development mariadb data (root) - Docker volume
db-tenant
: development mariadb data (tenants) - Docker volume
opam
: opam packages - Docker volume
build
: cached build directory to speed up development
This project is setup to run in a DevContainer. Ensure requirements to run in a DevContainer:
- Git installed
- Source Tree for GitLab setup (see Install user interface and Configure GitLab for Source Tree)
- Docker installed
- Visual Studio Code (VS Code) installed
- VS Code Extension Remote Container installed
Your SSH folder and Git config gets mapped to the container. You should be able to use SSH and Git inside the
container. Please ensure ~/.gitconfig
doesn't contain absolute paths (you may use the ~
profile prefix, i.e.
excludesfile = ~/.gitignore_global
). Please note: You probably have to update Sourcetree settings. In its
settings "General" tab uncheck "Allow Sourcetree to modify your global Mercurial and Git configuration files".
If needed, edit .devcontainer/docker-compose.override.yml
to suit your needs.
Click on the icon similar to "><" in the bottom left corner and select Remote-Containers: Reopen in Container
.
If any changes were made to files in .devcontainer
folder the Container should be rebuilt (Remote-Containers: Rebuild Container
)
NOTE: When the setup is fully installed, select
View
->Command Palette...
and run the commandOCaml: Restart Language Server
- The Makefile used in the DevContainer is located in the
.devcontainer
folder - Ports from outside (e.g. localhost)
- webserver
- root
3016
- tenant
3017
- root
- database
- root
3316
- tenant
3317
- root
- webserver
- Create a
.env.test
file - Add the following variables to it
DATABASE_URL=mariadb://root@database-root:3306/test
MYSQL_DATABASE=test_econ
- Prepare test database (migration/seeds) and run the tests
make test-clean
There is an Adminer
container added to the development package. To be able to use it, follow these few steps:
- Uncomment its line in the
.devcontainer/devcontainer.json
underrunServices
- Use
Remote-Containers: Rebuild Container
that it will also create and startup theAdminer
container - Open your web browser and open
localhost:8080
This behaviour is related to the ocaml-lsp-server (as a first impression), when using a ritght click on a function name and selecting "Go to Definition" it jumps to the capitalized filename instead of the correct and existing (in our case lowercased) filename.
This issue isn't related to ocaml-lsp-server it's depending on the underliing format of your data volume and it's ability to handle case sensitivity (link for MacOS and Windows WSL).
- Create a "Case-Sensitive" volume
- Clone the project on the new volume
- Delete all currently existing Container/Images/Volumes related to the pool tool
- Open the newly cloned project in VSCode
- Use "Reopen in Container"