Commit Graph

19 Commits

Author SHA1 Message Date
Tim Orling
662ca9a4be docker-compose.yml: drop version '3'
Drop the obsolete version: '3' property, it is no longer needed since
late 2020 (Docker Compose 1.27+) and is only informative:

https://nickjanetakis.com/blog/docker-tip-51-which-docker-compose-api-version-should-you-use
https://github.com/compose-spec/compose-spec/blob/master/04-version-and-name.md

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2024-01-12 14:16:22 -08:00
Tim Orling
490205e3a6 docker-compose.yml: mariadb:lts
We should really be striving to be compatible with
the latest mariadb LTS (currently 10.11).

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2024-01-12 14:16:22 -08:00
Tim Orling
bb79b3885e docker-compose.yml: bump mariadb from 10.3 to 10.4
Django 4.2 requires a minimum of 10.4

https://docs.djangoproject.com/en/4.2/releases/4.2/#dropped-support-for-mariadb-10-3

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2023-10-05 20:04:57 -07:00
Tim Orling
f1dbcde4c4 docker-compose: fix celery
In celery 5, the --workdir argument must come
before the 'worker' subcommand.

Without this, celery cannot load the layerindex
module and this causes the celery container to
continually restart.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-01-13 20:59:54 -08:00
Tim Orling
ecd1005ae2 docker-compose: bump mariadb to 10.3
10.2 was based on Ubuntu bionic 18.04,
bumping to 10.3 as it is the first release
on Ubuntu focal 20.04

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2022-01-13 20:59:10 -08:00
Paul Eggleton
31a2e3f043 dockersetup: support encryption/authentication for SMTP
Some SMTP servers are configured to require encrypted connections and
username & password, so provide options to enable those.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-07-17 11:31:04 +12:00
Paul Eggleton
778632a445 docker: remove hardcoded container names
This allows for multiple instances of the project to coexist on the same
machine.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-07-17 11:31:04 +12:00
Paul Eggleton
22133f74d0 docker: Increase max packet size to 128M
I've seen "MySQL server has gone away" errors in the logs, and this time
it isn't the timeout; one of the suggested fixes is to increase the max
packet size (and I have also seen errors in the mariadb logs indicating
that the max has been exceeded).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-07-17 11:31:04 +12:00
Paul Eggleton
51bf00c15a Enable task log/progress to work within docker
We need the task log dir to be shared between the app and celery
containers, so mount a volume and point both of them into it.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-07-17 11:31:04 +12:00
Paul Eggleton
69fe84b678 docker-compose: fix missing DATABASE_USER for layerscelery service
Without this, celery tasks were attempting to connect with the default
user (root) and failing because the passwords are different.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-07-17 11:31:04 +12:00
Paul Eggleton
ee7e5a0564 dockersetup: set site info and email host
In order to have registration/password reset emails working properly we
need to have both the site domain and email host/port set correctly.
Email host/port is easy to set (environment variable read into the
configuration). However, to set the site info, create a simple script
that we can call to do so.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-07-17 11:31:04 +12:00
Paul Eggleton
a052d8d7f7 docker: restart services automatically unless stopped
Restarting these services automatically is what you'd want in
production.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-07-17 11:30:56 +12:00
Paul Eggleton
7a248df9f5 dockersetup: use separate db account with lower privileges
Make the app should use a database account that has only the privileges
it needs rather than the root account for improved security.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-07-17 11:30:56 +12:00
Paul Eggleton
e78c4dae9c docker: enable user/password for RabbitMQ server
Add settings for user/password for the RabbitMQ server and make
dockersetup.py set it up. (The rabbitmq container intrinsically
understands RABBITMQ_DEFAULT_*, and for the sake of consistency I've
reused those variables for the other containers.)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-07-17 11:30:56 +12:00
Paul Eggleton
3bc7dce405 docker: set mariadb wait_timeout to upstream default
The default wait_timeout we are getting from the official MariaDB
container (as inherited from Debian) is 600s, which is too short if you
walk away while the setup script is running and it stops on the
"manage.py createsuperuser" step for longer than 10 minutes. We don't
really need this timeout, so just use the upstream default of 28800 (8h)
instead.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-07-17 11:30:56 +12:00
Paul Eggleton
efe74a451f dockersetup: add letsencrypt support
The application is most likely to be used in an internal setting,
however should someone want to make it accessible externally, add
support for Let's Encrypt certificates for serving via HTTPS.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-07-17 11:30:56 +12:00
Paul Eggleton
cb4955fe0b dockersetup: add HTTPS support and use by default
If we want a minimum level of security we should enable HTTPS. However,
the only practical way we can do that without the user having to do further
infrastructure setup and/or pay a certification authority is to use a
self-signed certificate. Do this by default, and also provide an option
to specify a previously obtained certificate/key pair.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-07-17 11:30:56 +12:00
Paul Eggleton
c717a827d3 docker: use quoted values
Avoids issues with certain characters in values.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-07-17 11:30:56 +12:00
Paul Eggleton
08c979ac58 docker: Add docker-compose file
This makes deployment (and updates) much easier. You still need to
follow some setup instructions in the docker/README file, but the number
of steps is reduced and most commands simplified.

Thanks to Konrad Scherer <Konrad.Scherer@windriver.com> for suggesting
this (although the docker-compose.yml here was written from scratch).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-07-17 11:30:56 +12:00