Skip to content

Commit

Permalink
docker exec -it documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
blt950 committed Jun 27, 2023
1 parent 99d3115 commit 05b3eb8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,27 @@ To setup your Docker instance simply follow these steps:
1. Pull the `ghcr.io/vatsim-scandinavia/control-center:v4` Docker image
2. Setup your MySQL database (not included in Docker image)
3. Configure the environment variables as described in the [CONFIGURE.md](CONFIGURE.md#environment)
4. Run the container and access it with `docker exec -it control-center bash`
- Run `php artisan migrate` to setup the database
- To ensure that users will not need to login after each time you re-deploy/upgrade the container, run `php artisan key:get`. Copy the key and set it as the `APP_KEY` environment variable in your docker configuration.
5. Setup a crontab outside the container to run `* * * * * docker exec --user www-data -i control-center php artisan schedule:run >/dev/null` every minute. This patches into the container and runs the required cronjobs.
6. Bind the 8080 (HTTP) and/or 8443 (HTTPS) port to your reverse proxy or similar.
4. Start the container in the background.
5. Setup the database.
```sh
docker exec -it control-center php artisan migrate
```
6. To ensure that users will not need to log in after each time you re-deploy or upgrade the container, you need to create and store an application key in your environment.
```sh
docker exec -it control-center php artisan key:get
```
Copy the key and set it as the `APP_KEY` environment variable in your Docker configuration.
7. Setup a crontab outside the container to run `* * * * * docker exec --user www-data -i control-center php artisan schedule:run >/dev/null` every minute. This patches into the container and runs the required cronjobs.
8. Bind the 8080 (HTTP) and/or 8443 (HTTPS) port to your reverse proxy or similar.

## Configuring

To have Control Center reflect your division correctly, you need to do some tweaks.

- Access your container with `docker exec -it control-center bash` and run give your user admin access by running `php artisan user:makeadmin` and following the instructions. Area need to be specified but can be any.
- Give your user admin access
```sh
docker exec -it control-center php artisan user:makeadmin
```
- You can now access `Administration -> Settings` in the menu to tweak the most basic settings for your division.
- You are also required to configure logic and datasets in the MySQL database as described in [CONFIGURE.md](CONFIGURE.md#database) with examples

Expand Down
11 changes: 9 additions & 2 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,20 @@ In the instructions where we use `docker exec` we assume your container is named
2. Configure the environment variables as described in the [CONFIGURE.md](CONFIGURE.md)
3. Start the container
4. Setup a crontab outside the container to run `* * * * * docker exec --user www-data -i control-center php artisan schedule:run >/dev/null` every minute. This patches into the container and runs the required cronjobs.
5. To ensure that users will not need to login after each time you re-deploy/upgrade the container, run `docker exec control-center php artisan key:get` from outside the container. Copy the key and set it as the `APP_KEY` environment variable in your docker configuration.
5. To ensure that users will not need to log in after each time you re-deploy or upgrade the container, you need to create and store an application key in your environment.
```sh
docker exec -it control-center php artisan key:get
```
Copy the key and set it as the `APP_KEY` environment variable in your Docker configuration.
6. Bind the 8080 (HTTP) and/or 8443 (HTTPS) port to your reverse proxy or similar.

#### Data Migration

1. Make sure that `DB_HANDOVER_` database config is present in your environment file or docker configuration. Do not remove this as it's required for the migration.
2. Run the migration with `php artisan migrate` inside the container, this will copy over the required data fields from Handover so CC can run on it's own
2. Run the migration, this will copy over the required data fields from Handover so CC can run on it's own
```sh
docker exec -it control-center php artisan migrate
```
3. If the migration was successful you may now remove the `DB_HANDOVER_*` environment settings as it'll no longer be used.
4. If you don't want to use Handover at all anymore, you can at this point change the OAUTH environment settings to the VATSIM OAuth settings.

Expand Down

0 comments on commit 05b3eb8

Please sign in to comment.