From b0328b5a34f3ece7493df6569f135df6f5220df6 Mon Sep 17 00:00:00 2001 From: JohnGrubba Date: Tue, 25 Jun 2024 09:49:35 +0200 Subject: [PATCH] Update Default Port Update Documentation --- .env | 4 ---- docker-compose.yml | 2 +- docs/getting-started/setup.md | 29 ++++++++++++++++++++++++++++- 3 files changed, 29 insertions(+), 6 deletions(-) delete mode 100644 .env diff --git a/.env b/.env deleted file mode 100644 index dbd07c1..0000000 --- a/.env +++ /dev/null @@ -1,4 +0,0 @@ -EMAIL_SENDER= -EMAIL_PSW= -SMTP_SERVER= -SMTP_PORT=465 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index a0f2921..97576c5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ services: container_name: ezauth-api build: "./src" ports: - - "3000:80" + - "3250:80" environment: - DATABASE_URL=mongodb://admin:admin@db/ezauth?authSource=admin&retryWrites=true&w=majority restart: always diff --git a/docs/getting-started/setup.md b/docs/getting-started/setup.md index 2a96f78..de9b4c0 100644 --- a/docs/getting-started/setup.md +++ b/docs/getting-started/setup.md @@ -32,4 +32,31 @@ After you have configured the service you can start it by running the following ``` bash docker compose up -d -``` \ No newline at end of file +``` +The service should now be running and you can access the API by navigating to `http://localhost:3250` in your browser. The API Documentation is available at `http://localhost:3250/docs`. + +### Further Customization +If you want to further customize the service you can take a look at the `docker-compose.yml` file in the root directory of the repository. This file contains all the configuration options for the service. You can change the port on which the service is running, the volume mounts, and the environment variables. + +#### API Configuration +The Prefix for all Parameters here is `services.api`. +The Following Environment Variables can be set in the `docker-compose.yml` file to configure the API: + + +| Parameter | Description | +|------------|-------------| +| `ports` | **Datatype:** String
**Default:** `"3250:80"`
Only change the left (host) side of the ports. The API will always run on Port 80 internally, and can be forwarded to any port on the host system. In this example `3250`. | +| `volumes` | **Datatype:** String
**Default:** `"./config:/app/config"`
The volume mount for the configuration file. Only change the left (host) side of the configuration folder directory. In this example `./config`. | + +#### Database Configuration +The Prefix for all Parameters here is `services.db.environment`. +When changing the database configuration, make sure to also change the `api` section in the `docker-compose.yml` file to reflect the new database connection. +The following environment variables can be set in the `docker-compose.yml` file to configure the database connection: + +| Parameter | Description | +|------------|-------------| +| `MONGO_INITDB_ROOT_USERNAME` | **Datatype:** String
**Default:** `"admin"`
The Root Username for the Database. | +| `MONGO_INITDB_ROOT_PASSWORD` | **Datatype:** String
**Default:** `"admin"`
The Root Password for the Database. | +| `MONGO_INITDB_DATABASE` | **Datatype:** String
**Default:** `"ezauth"`
The Database Name. | + +You can also change the location of the database data by changing the `volumes` section of the `db` section in the `docker-compose.yml` file. \ No newline at end of file