Flesh out docker-compose Cookiecutter template

This commit is contained in:
2022-06-04 23:36:18 +02:00
parent e6be888b91
commit 8b2c0cecca
27 changed files with 413 additions and 39 deletions

View File

@@ -0,0 +1,14 @@
# For the remainder of this Dockerfile EXAMPLE_ARG_FOR_DOCKERFILE will be
# available with a value of 'must_be_available_in_dockerfile', check out the env
# file at 'env/fully.qualified.domain.name.example' for reference.
# ARG EXAMPLE_ARG_FOR_DOCKERFILE
# Another env var, this one's needed in the example build step below:
# ARG GRAFANA_VERSION
# Example
# FROM "grafana:${GRAFANA_VERSION}"
# RUN apt-get update && \
# apt-get -y install \
# somepackage-6.q16-6-extra && \
# rm -rf /var/lib/apt/lists/*

View File

@@ -0,0 +1,14 @@
# For the remainder of this Dockerfile EXAMPLE_ARG_FOR_DOCKERFILE will be
# available with a value of 'must_be_available_in_dockerfile', check out the env
# file at 'env/fully.qualified.domain.name.example' for reference.
# ARG EXAMPLE_ARG_FOR_DOCKERFILE
# Another env var, this one's needed in the example build step below:
# ARG NGINX_VERSION
# Example
# FROM "nginx:${NGINX_VERSION}"
# RUN apt-get update && \
# apt-get -y install \
# somepackage-6.q16-6-extra && \
# rm -rf /var/lib/apt/lists/*

View File

@@ -0,0 +1,11 @@
services:
common-settings:
environment:
TZ: "${TIMEZONE:-Etc/UTC}"
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "10"
compress: "true"
restart: "${RESTARTPOLICY:-unless-stopped}"

View File

@@ -0,0 +1,19 @@
services:
grafana-build:
image: "grafana:${GRAFANA_VERSION}"
profiles: ["build", "build-grafana"]
build:
context: "build-context/grafana"
dockerfile: Dockerfile
args:
EXAMPLE_ARG_FOR_DOCKERFILE: "${EXAMPLE_ARG_FROM_ENV_FILE}"
GRAFANA_VERSION: "${GRAFANA_VERSION}"
nginx-build:
image: "nginx:${NGINX_VERSION}"
profiles: ["build", "build-nginx"]
build:
context: "build-context/nginx"
dockerfile: Dockerfile
args:
EXAMPLE_ARG_FOR_DOCKERFILE: "${EXAMPLE_ARG_FROM_ENV_FILE}"
NGINX_VERSION: "${NGINX_VERSION}"

View File

@@ -0,0 +1,47 @@
services:
grafana:
image: "grafana:${GRAFANA_VERSION}"
container_name: "grafana-grafana-${CONTEXT}"
networks:
grafana-cncf:
profiles: ["full", "grafana"]
extends:
file: common-settings.yml
service: common-settings
ports:
# - "8080:80"
volumes:
# - /opt/docker-data/grafana-grafana-cncf/grafana/data/db:/usr/lib/grafana
# - /opt/docker-data/grafana-grafana-cncf/grafana/data/logs:/var/log/grafana
# - /opt/docker-data/grafana-grafana-cncf/grafana/config:/etc/grafana
environment:
# GRAFANA_USER: ${GRAFANA_USER}
# GRAFANA_PASSWORD: ${GRAFANA_PASSWORD}
nginx:
image: "nginx:${NGINX_VERSION}"
container_name: "grafana-nginx-${CONTEXT}"
networks:
grafana-cncf:
profiles: ["full", "nginx"]
extends:
file: common-settings.yml
service: common-settings
ports:
# - "8080:80"
volumes:
# - /opt/docker-data/grafana-nginx-cncf/nginx/data/db:/usr/lib/nginx
# - /opt/docker-data/grafana-nginx-cncf/nginx/data/logs:/var/log/nginx
# - /opt/docker-data/grafana-nginx-cncf/nginx/config:/etc/nginx
environment:
# NGINX_USER: ${NGINX_USER}
# NGINX_PASSWORD: ${NGINX_PASSWORD}
networks:
grafana-cncf:
name: grafana-cncf
driver: bridge
driver_opts:
com.docker.network.enable_ipv6: "false"
ipam:
driver: default
config:
# - subnet: 172.21.184.0/24

View File

@@ -0,0 +1,30 @@
CONTEXT=cncf
# Set something sensible here and uncomment
# ---
# GRAFANA_VERSION=x.y.z
# NGINX_VERSION=x.y.z
# A ${LOCATION} var is usually not needed. It may be helpful when a ${CONTEXT}
# extends over more than one location e.g. to bind-mount location-specific
# config files or certificates into a container.
# ---
# LOCATION=
# Feel free to leave defaults. They apply while these vars are commented out
# ---
# RESTARTPOLICY=unless-stopped
# TIMEZONE=Etc/UTC
# See 'docker-compose.override.yml' for how to make a variable available in
# a Dockerfile
# ---
# EXAMPLE_ARG_FROM_ENV_FILE=must_be_available_in_dockerfile

View File

@@ -0,0 +1,14 @@
# For the remainder of this Dockerfile EXAMPLE_ARG_FOR_DOCKERFILE will be
# available with a value of 'must_be_available_in_dockerfile', check out the env
# file at 'env/fully.qualified.domain.name.example' for reference.
# ARG EXAMPLE_ARG_FOR_DOCKERFILE
# Another env var, this one's needed in the example build step below:
# ARG HASHICORPVAULT_VERSION
# Example
# FROM "hashicorpvault:${HASHICORPVAULT_VERSION}"
# RUN apt-get update && \
# apt-get -y install \
# somepackage-6.q16-6-extra && \
# rm -rf /var/lib/apt/lists/*

View File

@@ -0,0 +1,11 @@
services:
common-settings:
environment:
TZ: "${TIMEZONE:-Etc/UTC}"
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "10"
compress: "true"
restart: "${RESTARTPOLICY:-unless-stopped}"

View File

@@ -0,0 +1,10 @@
services:
hashicorpvault-build:
image: "hashicorpvault:${HASHICORPVAULT_VERSION}"
profiles: ["build"]
build:
context: "build-context/hashicorpvault"
dockerfile: Dockerfile
args:
EXAMPLE_ARG_FOR_DOCKERFILE: "${EXAMPLE_ARG_FROM_ENV_FILE}"
HASHICORPVAULT_VERSION: "${HASHICORPVAULT_VERSION}"

View File

@@ -0,0 +1,28 @@
services:
hashicorpvault:
image: "hashicorpvault:${HASHICORPVAULT_VERSION}"
container_name: "hashicorpvault-${CONTEXT}"
networks:
hashicorpvault-fsf:
extends:
file: common-settings.yml
service: common-settings
ports:
# - "8080:80"
volumes:
# - /opt/docker-data/hashicorpvault-fsf/data/db:/usr/lib/hashicorpvault
# - /opt/docker-data/hashicorpvault-fsf/data/logs:/var/log/hashicorpvault
# - /opt/docker-data/hashicorpvault-fsf/config:/etc/hashicorpvault
environment:
# HASHICORPVAULT_USER: ${HASHICORPVAULT_USER}
# HASHICORPVAULT_PASSWORD: ${HASHICORPVAULT_PASSWORD}
networks:
hashicorpvault-fsf:
name: hashicorpvault-fsf
driver: bridge
driver_opts:
com.docker.network.enable_ipv6: "false"
ipam:
driver: default
config:
# - subnet: 172.21.184.0/24

View File

@@ -0,0 +1,29 @@
CONTEXT=fsf
# Set something sensible here and uncomment
# ---
# HASHICORPVAULT_VERSION=x.y.z
# A ${LOCATION} var is usually not needed. It may be helpful when a ${CONTEXT}
# extends over more than one location e.g. to bind-mount location-specific
# config files or certificates into a container.
# ---
# LOCATION=
# Feel free to leave defaults. They apply while these vars are commented out
# ---
# RESTARTPOLICY=unless-stopped
# TIMEZONE=Etc/UTC
# See 'docker-compose.override.yml' for how to make a variable available in
# a Dockerfile
# ---
# EXAMPLE_ARG_FROM_ENV_FILE=must_be_available_in_dockerfile