Use a custom Docker image
This commit is contained in:
parent
7a9ea28a2a
commit
10c563c1e8
|
@ -10,7 +10,7 @@ RUN set -eux &&\
|
|||
# Create mongod user with same UID as mongodb in the official image \
|
||||
groupadd -g 999 mongod &&\
|
||||
useradd -M -r -g mongod -u 999 -d /var/lib/mongo -s /bin/false -c mongod mongod &&\
|
||||
microdnf -y --nodocs --setopt=install_weak_deps=0 install tini mongodb-org-server mongodb-org-shell mongodb-mongosh mongodb-org-tools &&\
|
||||
microdnf -y --nodocs --setopt=install_weak_deps=0 install tini mongodb-org-server mongodb-org-shell mongodb-org-tools &&\
|
||||
microdnf clean all &&\
|
||||
rm -rf /var/cache/yum/* /var/log/yum/* /var/lib/dnf/history*
|
||||
|
||||
|
|
|
@ -140,10 +140,9 @@ _EOF
|
|||
volumes = [
|
||||
"local/init-system.properties.sh:/entrypoint.d/10-init-system.properties.sh"
|
||||
]
|
||||
work_dir = "/local"
|
||||
mount {
|
||||
type = "tmpfs"
|
||||
target = "/opt/unifi/run"
|
||||
type = "tmpfs"
|
||||
target = "/opt/unifi/run"
|
||||
readonly = false
|
||||
}
|
||||
}
|
||||
|
@ -187,6 +186,7 @@ _EOF
|
|||
|
||||
task "mongo" {
|
||||
driver = [[ .unifi.mongo.driver | toJSON ]]
|
||||
user = 999
|
||||
|
||||
lifecycle {
|
||||
hook = "prestart"
|
||||
|
@ -195,6 +195,7 @@ _EOF
|
|||
|
||||
config {
|
||||
image = [[ .unifi.mongo.image | toJSON ]]
|
||||
command = "mongod"
|
||||
args = [
|
||||
"--config",
|
||||
"/local/mongod.conf"
|
||||
|
@ -210,24 +211,12 @@ _EOF
|
|||
|
||||
volume_mount {
|
||||
volume = "unifi-mongo"
|
||||
destination = "/data"
|
||||
destination = "/data/db"
|
||||
}
|
||||
|
||||
[[ template "common/resources.tpl" .unifi.mongo.resources ]]
|
||||
|
||||
}
|
||||
|
||||
task "whoami" {
|
||||
driver = "docker"
|
||||
config {
|
||||
image = "traefik/whoami"
|
||||
args = ["--port", "8787"]
|
||||
}
|
||||
resources {
|
||||
cpu = 10
|
||||
memory = 32
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,8 +42,8 @@ unifi:
|
|||
traefik:
|
||||
entrypoints:
|
||||
- unifi-portal
|
||||
middlewares:
|
||||
- ip-guests@file
|
||||
middlewares: []
|
||||
# - ip-guests@file
|
||||
|
||||
stun:
|
||||
traefik:
|
||||
|
@ -58,11 +58,11 @@ unifi:
|
|||
memory: 15
|
||||
|
||||
mongo:
|
||||
image: mongo:3.6
|
||||
image: danielberteaud/mongo:3.6
|
||||
driver: docker
|
||||
resources:
|
||||
cpu: 100
|
||||
memory: 384
|
||||
memory: 256
|
||||
volume:
|
||||
type: csi
|
||||
source: unifi-mongo
|
||||
|
|
Loading…
Reference in New Issue