Docker with WSL2 Usage

Give permissions for docker.

sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker

Activate Docker Desktop. Then write the command below.

'proxy' is the name of the network in networks section of docker-compose.yml file.

docker network create proxy

Run Locally

Run docker-build file (which runs docker-compose) from root.

chmod +x ./docker/docker-build.sh
./docker/docker-build.sh

Or if you don't have docker-build.sh, run docker compose directly.

docker-compose builds, creates, starts, and attaches to containers for a service. -d is to start the containers in the background.

docker compose -f ./docker-compose.yml up -d --build
# or if Dockerfile is in root and you want to run without build (like refresh)
docker compose up -d

If you want to test something on bash you can run:

docker run --rm -it idbox_gpt:latest bash
# directly run [don't forget -p]
docker run --rm -ti -p 8000:8000 idbox_gpt:latest

Run on Server [Portainer with CI/CD + Nginx]

  1. Open portainer page and create a stack.
  2. Select Git Repository.
  3. Create personal access token in Github and put the token in PAT section. Don't save the credentials.
  4. Select branch in repository reference.
  5. Enter docker-compose.yml path. (For example docker/docker-compose.yml)