Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Update docker compose flow #695

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions Side-Projects.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,30 @@ to your host computer's local disk

```bash
cd <directory with docker-compose.yml>
docker-compose up -d
docker compose up -d
```

Now as long as you don't `docker compose down`, the docker daemon (`sudo systemctl enable docker`) will automatically start the various containers every time the Pi boots.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do it need to be a 'Pi' or could it be just any host system?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks!


**Logs:**

Run `docker attach unifi_logs` to tail the various unifi logs files.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why would you want to "attach" to this container?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the only way I could figure out how to access the log files (to diagnose issues). Is there another way besides attach?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well if you just want to see all the logs, as that container was made for, you can just docker compose logs -f logs (first logs is the compose command, last one is the logs container)
But then if you want to go check the logs file manually, you can just exec into the container with docker compose exec controller bash and go into /unifi/logs (either the controller or logs container as they both have point to the same logs)


**Setting Options:**

* The `docker-compose.yml` file contains the options
passed to Unifi Controller when it starts.
Edit the `docker-compose.yml` file setting its values according to the
[Options on the command line.](./README.md#options-on-the-command-line)
* _Optional:_ Add additional `-e <any-environment-variables-you-want>` to the `docker-compose up` line
* _Optional:_ Add additional `-e <any-environment-variables-you-want>` to the `docker compose up` line

To change options to Unifi Controller::

```bash
cd <directory with docker-compose.yml>
docker-compose down # this stops Unifi Controller and MongoDB
docker compose down # this stops Unifi Controller and MongoDB
# ... edit the options in the docker-compose.yml file ...
docker-compose up ... # to resume operation
docker compose up ... # to resume operation
```

### External MongoDB environment variables
Expand Down
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
version: '2.3'
version: '3'
name: unifi
services:
mongo:
image: mongo:3.6
Expand Down Expand Up @@ -48,6 +49,7 @@ services:
depends_on:
- controller
command: bash -c 'tail -F /unifi/log/*.log'
tty: true
restart: always
volumes:
- log:/unifi/log
Expand Down