-
-
Save dogterbox/b8dd5fd7ad8ee3c7d60e7fcaa48143f3 to your computer and use it in GitHub Desktop.
Anchors in docker-compose.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.4" | |
x-defaults: &defaults | |
image: "dask-dev/dask-notebook" | |
# With lists, each entry requires its own anchor if you | |
# intend to extend/reuse an entry in concrete services. | |
configs: | |
- &configs_condarc | |
source: "condarc" | |
target: "/etc/conda/condarc" | |
mode: 444 | |
- &configs_pip | |
source: "pip" | |
target: "/etc/pip.conf" | |
mode: 444 | |
# For dictionaries anchor at the root. | |
environment: &environment | |
DASK_SCHEDULER_ADDRESS: "tcp://dask_scheduler:8786" | |
EXTRA_APT_PACKAGES: "g++ unixodbc-dev" | |
EXTRA_PIP_PACKAGES: "pip" | |
NB_GID: "100" | |
GRANT_SUDO: "yes" | |
volumes: | |
- &volumes_localtime | |
type: "bind" | |
source: "/etc/localtime" | |
target: "/etc/localtime" | |
read_only: yes | |
# Bind host certificates into container -- ensure that | |
# the path matches the container's expectations. | |
- &volumes_certificates | |
type: "bind" | |
source: "/etc/pki/tls/certs/ca-bundle.crt" | |
target: "/etc/ssl/certs/ca-certificates.crt" | |
read_only: yes | |
# Now define the services, overriding the values as | |
# needed: | |
services: | |
jupyterlab_foo: | |
<<: *defaults | |
environment: | |
<<: *environment | |
NB_USER: "foo" | |
jupyterlab_bar: | |
<<: *defaults | |
environment: | |
<<: *environment | |
NB_USER: "bar" | |
jupyterlab_bar: | |
<<: *defaults | |
environment: | |
<<: *environment | |
NB_USER: "baz" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment