- Install docker
- Install VSCode
- Install RemoteContainers VsCode Extension
- Check that you have docker and docker-compose (Mac / Linux)
docker -v
docker-compose -v
-
Download the scrubbed database Add it to the project root directory and rename it to expertiza.sql
-
Run expertiza in attached mode or detached mode in macs terminal or windows PowerShell
NOTE! Do not run with WSL on the first run! (causes volume generation issues)
Recommended for windows Attached (closing terminal closes expertiza):
docker-compose up
Detached (closing terminal does not close expertiza):
docker-compose up -d
- You can verify that everything is running by using
docker ps
NOTE This may take 5-10 minutes to set up the database and migrate on the first run!!
You should see mysql (healthy) and redis (healthy) and expertiza_web
- Getting terminal access to your instance of expertiza (running in a container!) In VSCode click the green icon in the bottom left.
Select
Remote Containers: Open Locally
or
Remote Containers: Reopen Locally
-
VSCode will install ruby extensions and you can click the plus button on the right to get a new terminal.
-
Run
bundle exec rails s -b 0.0.0.0
-
Setup is complete! Please read below to understand how to connect to expertiza, MYSQL and Redis
Go to your browser at http://localhost:3000 You should see expertiza load after 5 - 30 seconds.
From your local machine connect like you normally would, using these credentials
Host/IP: 127.0.0.1 Port: 3306 Username: root Password: expertiza
If you are inside the container (vscode terminal that has root@random-numbers-here) use the same credentials but change host/ip to mysql
.
From your local machine connect like you normally would, using these credentials
Host/IP: 127.0.0.1 Port: 6379
If you are inside the container (vscode terminal that has root@random-numbers-here) use the same credentials but change host/ip to redis
.
Docker containers allow you to run a much more efficient "virtual machine" or "container" than traditional VMs.
Why use docker? You can abstract your development, stage, and production environments to a set of repeatable commands. It effectively guarantees that an environment is the same on one host to the next.
docker-compose vs docker docker-compose allows you to run multiple docker containers (called services) in an orderly fashion. By default, docker containers are not exposed to your local machine, a port needs to be forwarded. docker-compose can handle this as well as setting up the connections between your containers and configuring them.
docker-compose up
Starts the expertiza services (mysql database, redis, and rails) in attached mode (if you close your terminal it will shutdown these services)
docker-compose up -d
Starts the expertiza services (mysql database, redis, and rails) in detached mode (if you close your terminal it will not shutdown these services)
docker-compose down
Shuts down local docker-compose containers/services
docker-compose up [service]
You can start specici services by specifying them in a list ex: docker-compose up mysql redis
docker ps
Shows running docker containers, forwarded ports and their health status if applicable
This means migrations were not ran
Do a Ctrl +C or docker-compose down
depending on if you are using -d or not
delete the .initialized file
docker-compose up
Try docker-compose down
Then docker-compose up
once it completes
If that fails, try
Restarting docker desktop or the docker daemon (linux). Find docker in the tray, hit quit docker desktop then relaunch