### Installing Docker CE Ubuntu Source: https://github.com/osrsbox/osrsbox-api/blob/master/README.md Installs the Docker Community Edition package using `sudo apt install docker-ce` on Ubuntu. This installs the core Docker daemon and client components necessary for running containers. ```Bash sudo apt install docker-ce ``` -------------------------------- ### Installing Docker Prerequisites Ubuntu Source: https://github.com/osrsbox/osrsbox-api/blob/master/README.md Installs necessary packages via `apt` that are required for adding the Docker repository and installing Docker on Ubuntu 18.04. These packages include utilities for handling HTTPS transport, certificates, curl downloads, and software properties. ```Bash sudo apt install apt-transport-https ca-certificates curl software-properties-common ``` -------------------------------- ### Building and Running Docker Containers osrsbox-api Source: https://github.com/osrsbox/osrsbox-api/blob/master/README.md Executes `docker-compose up --build` from the repository root. This command reads the `docker-compose.yml` file, builds the necessary Docker images for the API and database services if they don't exist or are outdated, and starts the defined containers. ```Bash docker-compose up --build ``` -------------------------------- ### Checking Docker APT Policy Ubuntu Source: https://github.com/osrsbox/osrsbox-api/blob/master/README.md Displays the APT policy for the `docker-ce` package. This command is used to confirm that the package will be installed from the correct, preferred Docker repository rather than a potentially outdated version from the default Ubuntu repositories. ```Bash apt-cache policy docker-ce ``` -------------------------------- ### Cloning osrsbox-api Repository Git Source: https://github.com/osrsbox/osrsbox-api/blob/master/README.md Clones the osrsbox-api repository and its submodules recursively using Git. This is the essential first step in obtaining the source code and dependencies required for setting up the development environment locally. ```Bash git clone --recursive https://github.com/osrsbox/osrsbox-api.git ``` -------------------------------- ### Updating APT Package List Ubuntu Source: https://github.com/osrsbox/osrsbox-api/blob/master/README.md Updates the local package list using `sudo apt update`. This command fetches the latest information about available packages, including those from the newly added Docker repository, making them ready for installation. ```Bash sudo apt update ``` -------------------------------- ### Adding Docker Repository APT Ubuntu Source: https://github.com/osrsbox/osrsbox-api/blob/master/README.md Adds the stable Docker repository for AMD64 architecture to the APT sources list on Ubuntu 18.04 Bionic. This allows the system's package manager (`apt`) to find and install Docker packages from the official Docker source. ```Bash sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" ``` -------------------------------- ### Downloading Docker Compose Linux Source: https://github.com/osrsbox/osrsbox-api/blob/master/README.md Downloads a specific version (1.25.0) of the Docker Compose binary for the current Linux system architecture and saves it to `/usr/local/bin`. Docker Compose is used to define and manage multi-container Docker applications. ```Bash sudo curl -L https://github.com/docker/compose/releases/download/1.25.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose ``` -------------------------------- ### Setting Docker Compose Permissions Linux Source: https://github.com/osrsbox/osrsbox-api/blob/master/README.md Grants executable permissions (`+x`) to the downloaded Docker Compose binary located at `/usr/local/bin` using `sudo chmod`. This step makes the `docker-compose` command executable. ```Bash sudo chmod +x /usr/local/bin/docker-compose ``` -------------------------------- ### Loading OSRS Data into MongoDB Docker Source: https://github.com/osrsbox/osrsbox-api/blob/master/README.md Executes a Python script located at `/scripts/mongo_insert_osrsbox.py` within the running `eve` Docker container (named `osrsbox-api-eve`). This script is responsible for populating the MongoDB database with the necessary OSRSbox data, making the API functional. ```Bash docker exec -t osrsbox-api-eve python3 /scripts/mongo_insert_osrsbox.py ``` -------------------------------- ### Adding Docker GPG Key Ubuntu Source: https://github.com/osrsbox/osrsbox-api/blob/master/README.md Downloads and adds the official Docker GPG key to the system's list of trusted keys. This step is crucial to verify the authenticity and integrity of Docker packages downloaded from the official repository on Ubuntu. ```Bash curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - ``` -------------------------------- ### Environment Variable Configuration .env Source: https://github.com/osrsbox/osrsbox-api/blob/master/README.md Shows the default contents of the `.env` file which stores critical environment variables for the application, including database credentials, port numbers, and project specific usernames/passwords. These values configure the Docker environment and should be modified for security before running the application locally. ```dotenv MONGO_INITDB_ROOT_USERNAME=ruser MONGO_INITDB_ROOT_PASSWORD=rpasswd MONGO_PORT=27017 DATABASE_NAME=osrsbox-db PROJECT_USERNAME=puser PROJECT_PASSWORD=ppasswd APP_ENV=prod ``` -------------------------------- ### Adding User to Docker Group Ubuntu Source: https://github.com/osrsbox/osrsbox-api/blob/master/README.md Adds the current user (`${USER}`) to the `docker` group using `sudo usermod -aG docker`. This grants the user permission to run Docker commands without needing `sudo`. The user must log out and log back in for this change to take effect. ```Bash sudo usermod -aG docker ${USER} ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.