Álvaro José Agámez Licha
Fullstack Developer at Zagalabs
Before WSL 2, working with Docker on Windows was not a very easy option, but now everything works like a charm, thanks to the fact that WSL 2 actually includes a full Linux kernel and Microsoft worked hand by hand with the Docker Team to make this integration possible.
The first step is download and install Docker Desktop 2.3.0.2 or a later release and restart your computer.
Now we need to add our local user to the docker-users group to be able to run Docker Desktop. To do this we need to run the following commands in a Powershell console with administrator privileges.
# With this Powershell command we get our username
PS > Get-LocalGroupMember -Group "Users"
PS > Add-LocalGroupMember -Group "docker-users" -Member "COMPUTER-ID\username"
Because we will Docker with a standard user, we need to execute docker-compose with sudo inside WSL.
$ sudo docker-compose up -d
The boilerplate have some structure and configurations to make a quick start. I try to follow a series of good practices for Express applications and others on how to structure a REST API.
We have to reduce the possibility to expose sensitive information, so we NEVER owe this kind of information in Docker or docker-compose files.
For this reason I set all the sensitive a docker-compose.override.yml that NEVER is stored in the Git repository.