Example of application that creates an encapsuled DASH and a nginx sidecar that will handle a basic authentication.
The idea behind this example is to show several aspects:
- The application is based on Dash which uses Flask behind the hood;
- The Docker container used on this example make use of a
depends_on
feature with a healthcheck which is useful for not showing errors; - nginx configured with
site.conf
that points to Dash container;
In order to create a htpasswd
file, please run the following command:
-
For the first time, inside
src/dashoffice
:$ htpasswd -c htpasswd <user_you_want_to_create>
-
Second time onwards:
$ htpasswd htpasswd <user_you_want_to_create>
For a different example, please check it out: https://kremalicious.com/how-to-quickly-generate-encrypted-logins-on-a-mac-for-htaccess-protected-sites/
$ docker compose build
$ docker compose up
Point your browser to http://localhost
. Yeah, it's listening on 80.