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

Provide a Docker Compose example #1168

Merged
merged 3 commits into from
Jul 27, 2018
Merged

Conversation

@virtualtam virtualtam added documentation proxy hosting behind reverse proxies server docker containers & cloud labels Jun 26, 2018
@virtualtam virtualtam added this to the 0.10.0 milestone Jun 26, 2018
@virtualtam virtualtam self-assigned this Jun 26, 2018
@ArthurHoaro
Copy link
Member

I had an issue with jwilder's nginx proxy because it doesn't set the X-Forwarded-Host header by default (see), and I had to manually add it, otherwise the SERVER_NAME was blank. Maybe there is an easier solution though.

Also, is it possible to put the docker-composer files under .docker directory?

@virtualtam virtualtam force-pushed the docker/compose branch 2 times, most recently from db24968 to d65144d Compare June 30, 2018 22:15
@virtualtam
Copy link
Member Author

X-Forwarded-Host

That's right, I usually override this as well on a per-virtualhost basis. The main doc looks obsolete, as Nginx configuration is generated by docker-gen using a template that is deployed to /app/nginx.tmpl and can be overridden by bind-mounting (argh!) a custom template. This is definitely not ideal as I would like to go for a simple solution to get users started.

I'll look into alternatives such as Træfik and Caddy(https://caddyserver.com/), which are cloud-ready and come with Let's Encrypt support out-of-the-box.

put docker-compose files under .docker directory

.docker contains deployment resources used when building Docker images, so it should not feature Compose configuration.

On a more subjective perspective, I like to find docker-compose.yml besides a Dockerfile when looking at source code, as it shows that maintainers have put in the effort of packaging their software for Docker, and provide an example with Compose, that users can use and potentially tweak to fit their use-case.

I don't know where the .env file should live though; docker-compose has a flag to select the YAML configuration file, but none for choosing an alternate environment file (short of declaring environment variables on the command-line - again, not ideal for the sake of simplicity).

@virtualtam virtualtam changed the title WIP: Provide a Docker Compose example WIP: Provide a Docker Compose example [Nginx] Jul 1, 2018
@virtualtam
Copy link
Member Author

Træfik alternative in #1170, tested on the cheapest DigitalOcean Droplet (VPS) available :)

@virtualtam virtualtam changed the title WIP: Provide a Docker Compose example [Nginx] WIP: Provide a Docker Compose example Jul 1, 2018
@virtualtam virtualtam force-pushed the docker/compose branch 2 times, most recently from 6807966 to 6ae39ed Compare July 1, 2018 14:06
@virtualtam virtualtam changed the title WIP: Provide a Docker Compose example Provide a Docker Compose example Jul 1, 2018
@virtualtam virtualtam requested review from ArthurHoaro and nodiscc July 1, 2018 14:07
@virtualtam
Copy link
Member Author

PR reworked with Træfik, along with a guide on how to setup a VPS with Docker, Compose and Shaarli images :)

@virtualtam virtualtam force-pushed the docker/compose branch 2 times, most recently from 5c9f4ae to a608109 Compare July 5, 2018 16:46

- [Droplets Overview](https://www.digitalocean.com/docs/droplets/overview/)
- [Pricing](https://www.digitalocean.com/pricing/)
- [How to Create a Droplet from the DigitalOcean Control Panel ](https://www.digitalocean.com/docs/droplets/how-to/create/)
Copy link
Member

Choose a reason for hiding this comment

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

extra space Panel ](http

(HTTP with TLS encryption).

Domain names can be obtained from registrars through hosting providers such as
[Gandhi](https://www.gandi.net/en/domain).
Copy link
Member

Choose a reason for hiding this comment

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

Gandi

```

### Setting up Docker Compose
_The following instructions are from the
Copy link
Member

@nodiscc nodiscc Jul 7, 2018

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

In addition a short introductory sentence about what docker compose is/does would be nice:

Docker Compose is a tool for defining and running multi-container Docker applications. It uses YAML files to configure the application's services and performs the creation and start-up process of all the containers with a single command.

Copy link
Member Author

Choose a reason for hiding this comment

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

I fear adding to much information would clutter the guides, though links to Docker and Compose documentation could be featured in the "Goals" introductory section

- [Get Docker CE for Debian](https://docs.docker.com/install/linux/docker-ce/debian/)
- [docker logs](https://docs.docker.com/engine/reference/commandline/logs/)
- [Volumes](https://docs.docker.com/storage/volumes/)
- [Install Docker Compose](Install Docker Compose)
Copy link
Member

Choose a reason for hiding this comment

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

Broken link

- Backup, restore, import and export: Backup,-restore,-import-and-export.md
- Various hacks: Various-hacks.md
- Guides:
- Install Shaarli on Debian 9 with Docker: guides/install-shaarli-with-debian9-and-docker.md
Copy link
Member

Choose a reason for hiding this comment

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

page title and filename do not match

Copy link
Member Author

Choose a reason for hiding this comment

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

they don't have to, this makes for nicer page slugs when generating the docs

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
@virtualtam
Copy link
Member Author

PR updated; @nodiscc I went for something in-between, with a brief link and description of each tool in the introductory section, and a couple more links in the Resources section.

@nodiscc
Copy link
Member

nodiscc commented Jul 12, 2018

This is good, it's always nice to have some context.

You could do a pass of jpegoptim on the images if you think it's worth it:

$ jpegoptim *
01-create-droplet-distro.jpg 839x356 24bit N JFIF  [OK] 23677 --> 20909 bytes (11.69%), optimized.
02-create-droplet-region.jpg 994x348 24bit N JFIF  [OK] 26230 --> 21603 bytes (17.64%), optimized.
03-create-droplet-size.jpg 500x318 24bit N JFIF  [OK] 22666 --> 20860 bytes (7.97%), optimized.
04-finalize.jpg 997x348 24bit N JFIF  [OK] 32830 --> 28233 bytes (14.00%), optimized.
05-droplet.jpg 799x189 24bit N JFIF  [OK] 14516 --> 11977 bytes (17.49%), optimized.
06-domain.jpg 890x30 24bit N JFIF  [OK] 5398 --> 4499 bytes (16.65%), optimized.
07-installation.jpg 1094x647 24bit N JFIF  [OK] 50432 --> 42832 bytes (15.07%), optimized.

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
@virtualtam
Copy link
Member Author

a pass of jpegoptim

Well it doesn't hurt, done :)

@ArthurHoaro
Copy link
Member

The path to the images is wrong in your guide page. They point to doc/md/images while the images are in doc/md/guides/images/.

@virtualtam
Copy link
Member Author

Yes, MkDocs has a weird behaviour regarding file inclusion when using plain HTML instead of Markdown: mkdocs/mkdocs#991

@virtualtam virtualtam merged commit 8fdd65b into shaarli:master Jul 27, 2018
@virtualtam virtualtam deleted the docker/compose branch July 27, 2018 17:25
@virtualtam
Copy link
Member Author

Thanks @ArthurHoaro and @nodiscc for the reviews and feedback :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker containers & cloud documentation proxy hosting behind reverse proxies server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants