I have a problem :)
I wanted to run a docker-compose for the first time.
But he got it wrong
It is this one:
https://github.com/navilg/media-stack
Here is my error message:
root#ubuntu:~/docker-compose/media-stack# docker-compose --profile stack-2 up -d
ERROR: The Compose file './docker-compose.yml' is invalid because:
'name' does not match any of the regexes: '^x-'
You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the services key, or omit the version key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/
Here are my versions:
root#ubuntu:~/docker-compose/media-stack# docker version
Customer:
Version: 20.10.16
API version: 1.41
Go version: go1.18.1
Git commit: 20.10.16-0ubuntu1
Built: Thu May 12 20:45:12 2022
OS/Arch: linux/arm64
Context: default
Experimental: true
server:
Engine:
Version: 20.10.16
API version: 1.41 (minimum version 1.12)
Go version: go1.18.1
Git commit: 20.10.16-0ubuntu1
Built: Thu May 12 20:04:31 2022
OS/Arch: linux/arm64
Experimental: false
containerd:
Version: 1.6.4-0ubuntu1.1
GitCommit:
runc:
Version: 1.1.2-0ubuntu1.1
GitCommit:
docker-init:
Version: 0.19.0
GitCommit:
root#ubuntu:~/docker-compose/media-stack# docker-compose version
docker-compose version 1.29.2, build unknown
docker-py version: 5.0.3
CPython version: 3.10.7
OpenSSL version: OpenSSL 3.0.5 5 Jul 2022
I tried to change version on the docker-compose to version 1 or 2 and 3 but nothing works.
Here is the docker-compose:
version: "3.9"
name: media-stack
services:
vpn:
## Read https://github.com/qdm12/gluetun/wiki for details on configuring VPN for different service providers.
profiles: ["vpn", "stack-2"]
container_name: vpn
image: qmcgaw/gluetun:v3.32
cap_add:
- NET_ADMIN
environment:
- VPN_SERVICE_PROVIDER=${VPN_SERVICE_PROVIDER:-nordvpn} # Valid values: nordvpn, expressvpn, protonvpn, surfshark or custom
- OPENVPN_USER=${OPENVPN_USER:-""}
- OPENVPN_PASSWORD=${OPENVPN_PASSWORD:-""}
## For list of server regions and countries, visit https://raw.githubusercontent.com/qdm12/gluetun/master/internal/storage/servers.json
## SERVER_REGIONS is required for NordVPN and Surfshark VPN. Comment SERVER_COUNTRIES if SERVER_REGIONS is used.
- SERVER_REGIONS=${SERVER_REGIONS:-Switzerland}
## SERVER_COUNTRIES is required for ExpressVPN and ProtonVPN. Comment SERVER_REGIONS if SERVER_COUNTRIES is used.
# - SERVER_COUNTRIES=${SERVER_COUNTRIES:-Netherlands}
# - FREE_ONLY=on # Valid with protonvpn only. on if using free service provided by protonvpn
## Enable below if VPN_SERVICE_PROVIDER=custom
# - VPN_TYPE=openvpn # or wireguard.
## If VPN_TYPE is openvpn
# - OPENVPN_CUSTOM_CONFIG=/gluetun/custom.conf
## If VPN_TYPE is wireguard. Replace below env variables as required.
# - VPN_ENDPOINT_IP=1.2.3.4 # Replace with your wg endpoint ip or domain
# - VPN_ENDPOINT_PORT=51820 # Replace with wg server port
# - WIREGUARD_PUBLIC_KEY=wAUaJMhAq3NFutLHIdF8AN0B5WG8RndfQKLPTEDHal0= # Replace with your wg public key
# - WIREGUARD_PRIVATE_KEY=wOEI9rqqbDwnN8/Bpp22sVz48T71vJ4fYmFWujulwUU= # Replace with your wg client private key
# - WIREGUARD_PRESHARED_KEY=xOEI9rqqbDwnN8/Bpp22sVz48T71vJ4fYmFWujulwUU= # Replaced with your wg pre-shared key
# - WIREGUARD_ADDRESSES="10.64.222.21/32" # Replace with wg address
## Enable volume if custom VPN_SERVICE_PROVIDER is used
# volumes:
# - /yourpath/yourconfig.conf:/gluetun/config.conf:ro
networks:
- mynetwork
ports:
# qbittorrent ports
- 5080:5080
- 6881:6881
- 6881:6881/udp
# prowlarr ports
- 9696:9696
# Transmission ports. Uncomment below if Transmission is used with VPN
# - 9091:9091
# - 51413:51413
# - 51413:51413/udp
restart: "unless-stopped"
transmission:
profiles: ["tx", "stack-1"]
container_name: transmission
image: lscr.io/linuxserver/transmission:3.00-r6
networks:
- mynetwork
# network_mode: service:vpn # Uncomment this line if vpn is enabled
environment:
- PUID=1000
- PGID=1000
- TZ=UTC
- USER=admin
- PASS=nimdatx
## Comment below ports if VPN is enabled.
ports:
- 9091:9091
- 51413:51413
- 51413:51413/udp
volumes:
- tx-config:/config
- torrent-downloads:/downloads
- tx-watch:/watch
restart: "unless-stopped"
## Default credentials - Username: admin password: adminadmin ##
## Change password after install from UI --> Tools --> Options --> WebUI ##
qbittorrent:
container_name: qbittorrent
profiles: ["qbt", "stack-2"]
image: lscr.io/linuxserver/qbittorrent:4.5.0
# Comment this if vpn is disabled
depends_on:
- vpn
networks:
- mynetwork
network_mode: service:vpn # Comment this line if vpn is disabled
environment:
- PUID=1000
- PGID=1000
- TZ=UTC
- WEBUI_PORT=5080
volumes:
- qbittorrent-config:/config
- torrent-downloads:/downloads
## Uncomment below ports if VPN is disabled.
# ports:
# - 5080:5080
# - 6881:6881
# - 6881:6881/udp
restart: "unless-stopped"
radarr:
profiles: ["base", "radarr", "stack-1", "stack-2"]
container_name: radarr
image: lscr.io/linuxserver/radarr:4.2.4
networks:
- mynetwork
environment:
- PUID=1000
- PGID=1000
- TZ=UTC
ports:
- 7878:7878
volumes:
- radarr-config:/config
- torrent-downloads:/downloads
restart: "unless-stopped"
sonarr:
profiles: ["base", "sonarr", "stack-1", "stack-2"]
image: lscr.io/linuxserver/sonarr:develop-version-4.0.0.269
container_name: sonarr
networks:
- mynetwork
environment:
- PUID=1000
- PGID=1000
- TZ=UTC
volumes:
- sonarr-config:/config
- torrent-downloads:/downloads
ports:
- 8989:8989
restart: unless-stopped
jackett:
profiles: ["jackett", "stack-1"]
container_name: jackett
image: lscr.io/linuxserver/jackett:v0.20.2309
networks:
- mynetwork
environment:
- PUID=1000
- PGID=1000
- TZ=UTC
volumes:
- jackett-config:/config
- jackett-blackhole:/downloads
ports:
- 9117:9117
restart: unless-stopped
prowlarr:
profiles: ["prowlarr", "stack-2"]
container_name: prowlarr
image: linuxserver/prowlarr:0.4.9-develop
# Comment this if vpn is disabled
depends_on:
- vpn
network_mode: service:vpn # Comment this line if vpn is disabled
networks:
- mynetwork
environment:
- PUID=1000
- PGID=1000
- TZ=UTC
volumes:
- prowlarr-config:/config
## Uncomment below ports if VPN is disabled.
# ports:
# - 9696:9696
restart: unless-stopped
jellyfin:
profiles: ["base", "jelly", "stack-1", "stack-2"]
image: lscr.io/linuxserver/jellyfin:10.8.8
container_name: jellyfin
networks:
- mynetwork
environment:
- PUID=1000
- PGID=1000
- TZ=UTC
volumes:
- jellyfin-config:/config
- torrent-downloads:/data
# devices:
# - /dev/videoN:/dev/videoN # Mount GPU device
ports:
- 8096:8096
- 7359:7359/udp
- 8920:8920
restart: unless-stopped
volumes:
torrent-downloads:
radarr-config:
sonarr-config:
jackett-config:
jackett-blackhole:
prowlarr-config:
jellyfin-config:
qbittorrent-config:
tx-config:
tx-watch:
networks:
mynetwork:
external: true
Have you ever seen this problem?
Thank you for your attention.
Related
I have problem with minio, not started on selected domain - 502 error.
my docker-compose.yml for nginx proxy reverse + le
services:
nginx:
container_name: nginx
image: nginxproxy/nginx-proxy
restart: unless-stopped
ports:
- 80:80
- 443:443
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- /var/docker/nginx/html:/usr/share/nginx/html
- /var/docker/nginx/certs:/etc/nginx/certs
- /var/docker/nginx/vhost:/etc/nginx/vhost.d
logging:
options:
max-size: "10m"
max-file: "3"
letsencrypt-companion:
container_name: nginx-le
image: jrcs/letsencrypt-nginx-proxy-companion
restart: unless-stopped
volumes_from:
- nginx
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /var/docker/nginx/acme:/etc/acme.sh
environment:
DEFAULT_EMAIL: mail#mail.com
docker-compose.yml for minio
version: '2'
services:
minio:
container_name: minio.domain.com
command: server /data --console-address ":9001"
environment:
- MINIO_ROOT_USER=admin
- MINIO_ROOT_PASSWORD=supersecret
- MINIO_BROWSER_REDIRECT_URL=https://minio.domain.com
- MINIO_DOMAIN=minio.domain.com
image: quay.io/minio/minio:latest
volumes:
- minio:/data
restart: unless-stopped
expose:
- "9000"
- "9001"
environment:
VIRTUAL_HOST: minio.domain.com
LETSENCRYPT_HOST: minio.domain.com
networks:
- proxy
networks:
proxy:
external:
name: nginx_default
volumes:
minio:
logs from docker logs for minio container
Warning: Default parity set to 0. This can lead to data loss.
WARNING: Detected default credentials 'minioadmin:minioadmin', we recommend that you change these values with 'MINIO_ROOT_USER' and 'MINIO_ROOT_PASSWORD' environment variables
MinIO Object Storage Server
Copyright: 2015-2022 MinIO, Inc.
License: GNU AGPLv3 <https://www.gnu.org/licenses/agpl-3.0.html>
Version: RELEASE.2022-12-12T19-27-27Z (go1.19.4 linux/amd64)
Status: 1 Online, 0 Offline.
API: http://192.168.0.7:9000 http://127.0.0.1:9000
Console: http://192.168.0.7:9001 http://127.0.0.1:9001
Documentation: https://min.io/docs/minio/linux/index.html
When I put in docker-compose for minio:
ports:
- '9000:9000'
- '9001:9001'
Minio working, but for all domain on my server.
How I can fix that minio show only on minio.domain.com ?
I am new to this today. I have been trying to figure out what the problem is all day.
docker-compose version 1.28.5, build 324b023a
I run:
docker-compose up -d
and I get:
ERROR: The Compose file './docker-compose.yml' is invalid because:
Unsupported config option for services.teslamate: 'database'
version: "3"
services:
teslamate:
image: teslamate/teslamate
restart: always
environment:
- ENCRYPTION_KEY= <Insert Key>
- DB_USER=teslamate
- DB_PASS= <Insert password>
- DB_NAME=teslamate
- DB_HOST=database
- MQTT_HOST=mosquitto
- VIRTUAL_HOST=<Insert IP address>
# if you're going to access the UI from another machine replace
# "localhost" with the hostname / IP address of the docker host.
- TZ=US # (optional) replace to use local time in debug logs. See "Configuration".
ports:
- 4000:4000
volumes:
- ./import:/opt/app/import
cap_drop:
- all
database:
image: postgres:14
restart: always
environment:
- POSTGRES_USER=teslamate
- POSTGRES_PASSWORD= <Insert password>
- POSTGRES_DB=teslamate
volumes:
- teslamate-db:/var/lib/postgresql/data
grafana:
image: teslamate/grafana
restart: always
environment:
- DATABASE_USER=teslamate
- DATABASE_PASS= goforit
- DATABASE_NAME=teslamate
- DATABASE_HOST=database
ports:
- 3000:3000
volumes:
- teslamate-grafana-data:/var/lib/grafana
mosquitto:
image: eclipse-mosquitto:2
restart: always
command: mosquitto -c /mosquitto-no-auth.conf
# ports:
# - 1883:1883
volumes:
- mosquitto-conf:/mosquitto/config
- mosquitto-data:/mosquitto/data
volumes:
teslamate-db:
teslamate-grafana-data:
mosquitto-conf:
mosquitto-data:
Could someone please let me know what is wrong?
Thank you,
It is just a Yaml indentation problem. Your services teslamate, database, grafana and mosquito needs to have the same indentation, otherwise database is seen as a property of teslamate and it is not a valid property for docker-compose.
version: "3"
services:
teslamate:
image: teslamate/teslamate
restart: always
environment:
- ENCRYPTION_KEY= <Insert Key>
- DB_USER=teslamate
- DB_PASS= <Insert password>
- DB_NAME=teslamate
- DB_HOST=database
- MQTT_HOST=mosquitto
- VIRTUAL_HOST=<Insert IP address>
# if you're going to access the UI from another machine replace
# "localhost" with the hostname / IP address of the docker host.
- TZ=US # (optional) replace to use local time in debug logs. See "Configuration".
ports:
- 4000:4000
volumes:
- ./import:/opt/app/import
cap_drop:
- all
database:
image: postgres:14
restart: always
environment:
- POSTGRES_USER=teslamate
- POSTGRES_PASSWORD= <Insert password>
- POSTGRES_DB=teslamate
volumes:
- teslamate-db:/var/lib/postgresql/data
grafana:
image: teslamate/grafana
restart: always
environment:
- DATABASE_USER=teslamate
- DATABASE_PASS= goforit
- DATABASE_NAME=teslamate
- DATABASE_HOST=database
ports:
- 3000:3000
volumes:
- teslamate-grafana-data:/var/lib/grafana
mosquitto:
image: eclipse-mosquitto:2
restart: always
command: mosquitto -c /mosquitto-no-auth.conf
# ports:
# - 1883:1883
volumes:
- mosquitto-conf:/mosquitto/config
- mosquitto-data:/mosquitto/data
volumes:
teslamate-db:
teslamate-grafana-data:
mosquitto-conf:
mosquitto-data:
I have traefik setup on a virtual server on my network (192.168.1.41). I'm trying to proxy multiple local services so they're available on *.local. My internal DNS points *.local to 192.168.1.41.
With the following docker-compose.yml:
---
version: "2"
services:
homer:
image: b4bz/homer
#To build from source, comment previous line and uncomment below
#build: .
container_name: homer
volumes:
- /home/mbell/homer/assets/:/www/assets
ports:
- 8081:8080
#environment:
# - UID=1000
# - GID=1000
restart: unless-stopped
tty: true
labels:
- "traefik.enable=true"
- "traefik.docker.network=web"
- "traefik.http.routers.homer.rule=(`dashboard.local`)"
- "traefik.http.routers.homer.entrypoints=web"
- "traefik.http.services.homer.loadbalancer.server.port=8081"
networks:
- web
networks:
web:
external: true
I think I'm write in assuming that it should run as dashboard.local but it only works on dashboard.local:8081
How do I make it work so it's only available on dashboard.local?
This line:
"traefik.http.routers.homer.rule=(`dashboard.local`)"
Should be:
"traefik.http.routers.homer.rule=Host(`dashboard.local`)"
I can send post request to Nuxeo server using http://localhost:8080 base address from local. When I add docker support to my app, my app can not send post request to nuxeo server using http://nuxeo_container_name:80 base address. It returns badRequest. How can I solve it? Nuxeo server and app are in the same docker network.
This is my docker-compose for nuxeo server. I use nuxeo_app_server in my app as nuxeo container name.
version: "3.5"
networks:
nuxnet:
name: network
services:
nginx:
container_name: nuxeo_app_server
build: nginx
ports:
# For localhost use, the exposed nginx port
# must match the localhost:port below in NUXEO_URL
- "8080:80"
#- "443:443"
cap_add:
- NET_BIND_SERVICE
links:
- nuxeo1
# - nuxeo2
environment:
USE_STAGING: 1
# default is 4096, but gcloud requires 2048
KEYSIZE: 2048
DOMAIN_LIST: /etc/nginx/conf.d/domains.txt
devices:
- "/dev/urandom:/dev/random"
sysctls:
- net.core.somaxconn=511
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d:ro
- certs:/etc/ssl/acme
networks:
- nuxnet
restart: always
nuxeo1:
image: nuxeo
hostname: nuxeo1
links:
- redis
- es
- db
env_file:
- ./nuxeo/setup.env
environment:
# Each nuxeo container must have a unique cluster id
NUXEO_CLUSTER_ID: 1
# URL that a user would use to access nuxeo UI or API
# For localhost urls, the port must match the exposted nginx port above
NUXEO_URL: http://localhost:8080/nuxeo
# JAVA memory tuning -Xms, -Xmx
JVM_MS: 1024m
JVM_MX: 2048m
devices:
- "/dev/urandom:/dev/random"
volumes:
- ./nuxeo/init:/docker-entrypoint-initnuxeo.d:ro
- app-data:/var/lib/nuxeo
- app-logs:/var/log/nuxeo
networks:
- nuxnet
restart: always
redis:
# note: based on alpine:3.6
# see https://hub.docker.com/_/redis/
image: redis:3.2-alpine
volumes:
- redis-data:/data
networks:
- nuxnet
restart: always
es:
image: elasticsearch:2.4-alpine
volumes:
- es-data:/usr/share/elasticsearch/data
- es-plugins:/usr/share/elasticsearch/plugins
- es-config:/usr/share/elasticsearch/config
- ./elasticsearch/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
environment:
# settings below add -Xms400m -Xmx1g
ES_MIN_MEM: 500m
EX_MAX_MEM: 1g
security_opt:
- seccomp:unconfined
networks:
- nuxnet
restart: always
db:
image: postgres:9.6-alpine
# note mem tuning suggestions in the following two links
# https://doc.nuxeo.com/nxdoc/postgresql/
# https://doc.nuxeo.com/nxdoc/postgresql/#adapt-your-configuration-to-your-hardware
environment:
POSTGRES_USER: nuxeo
POSTGRES_PASSWORD: nuxeo
POSTGRES_DB: nuxeo
POSTGRES_INITDB_ARGS: "-E UTF8"
PGDATA: /var/lib/postgresql/data
volumes:
- db-store:/var/lib/postgresql/data
- ./postgresql/postgresql.conf:/etc/postgresql.conf:ro
command: postgres -c config_file=/etc/postgresql.conf
networks:
- nuxnet
restart: always
volumes:
# to view current data, run bin/view-data.sh
certs:
app-logs: # all server logs, can be shared between instances
app-data: # contains app data and packages (store cache), can be shared between instances
db-store: # postgres database
es-data:
es-plugins:
es-config:
redis-data:
I succeed to make REST request between two containers using container name and default port.
Did you try with URL : http://nuxeo1:8080 ?
I would like to build a docker landscape. I use a container with a traefik (v2. 1) image and a mysql container for multiple databases.
traefik/docker-compose.yml
version: "3.3"
services:
traefik:
image: "traefik:v2.1"
container_name: "traefik"
restart: always
command:
- "--log.level=DEBUG"
- "--api=true"
- "--api.dashboard=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--providers.docker.network=proxy"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--entrypoints.traefik-dashboard.address=:8080"
- "--certificatesresolvers.devnik-resolver.acme.httpchallenge=true"
- "--certificatesresolvers.devnik-resolver.acme.httpchallenge.entrypoint=web"
#- "--certificatesresolvers.devnik-resolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
- "--certificatesresolvers.devnik-resolver.acme.email=####"
- "--certificatesresolvers.devnik-resolver.acme.storage=/letsencrypt/acme.json"
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- "./letsencrypt:/letsencrypt"
- "./data:/etc/traefik"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
networks:
- "proxy"
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik.rule=Host(`devnik.dev`)"
- "traefik.http.routers.traefik.entrypoints=traefik-dashboard"
- "traefik.http.routers.traefik.tls.certresolver=devnik-resolver"
#basic auth
- "traefik.http.routers.traefik.service=api#internal"
- "traefik.http.routers.traefik.middlewares=auth"
- "traefik.http.middlewares.auth.basicauth.usersfile=/etc/traefik/.htpasswd"
#Docker Networks
networks:
proxy:
database/docker-compose.yml
version: "3.3"
services:
#MySQL Service
mysql:
image: mysql:5.7
container_name: mysql
restart: always
ports:
- "3306:3306"
volumes:
#persist data
- ./mysqldata/:/var/lib/mysql/
- ./init:/docker-entrypoint-initdb.d
networks:
- "mysql"
environment:
MYSQL_ROOT_PASSWORD: ####
TZ: Europe/Berlin
#Docker Networks
networks:
mysql:
driver: bridge
For the structure I want to control all projects via multiple docker-compose files. These containers should run on the same network as the traefik container and some with the mysql container.
This also works for the following case (but only sometimes)
dev-releases/docker-compose.yml
version: "3.3"
services:
backend:
image: "registry.gitlab.com/devnik/dev-releases-backend/master:latest"
container_name: "dev-releases-backend"
restart: always
volumes:
#laravel logs
- "./logs/backend:/app/storage/logs"
#cron logs
- "./logs/backend/cron.log:/var/log/cron.log"
labels:
- "traefik.enable=true"
- "traefik.http.routers.dev-releases-backend.rule=Host(`dev-releases.backend.devnik.dev`)"
- "traefik.http.routers.dev-releases-backend.entrypoints=websecure"
- "traefik.http.routers.dev-releases-backend.tls.certresolver=devnik-resolver"
networks:
- proxy
- mysql
environment:
TZ: Europe/Berlin
#Docker Networks
networks:
proxy:
external:
name: "traefik_proxy"
mysql:
external:
name: "database_mysql"
As soon as I restart the containers in dev-releases/ via docker-compose up -d I get the typical error "Gateway timeout" when calling them in the browser.
As soon as I comment the network networks: #- mysql and restart the docker-compose in dev-releases/ it works again.
My guess is that I have not configured the external networks correctly. Is it not possible to use 2 external networks?
I'd like some container have access to the 'mysql' network but it should not be accessible for the whole traefik network.
Let me know if you need more information
EDIT (26.03.2020)
I make it running.
I put all my containers into one network "proxy". It seems mysql also have to be in the proxy network.
So I add following to database/docker-compose.yml
networks:
proxy:
external:
name: "traefik_proxy"
And removed the database_mysql network out of dev-releases/docker-compose.yml
based on the names of the files, your mysql network should be mysql_mysql.
you can verify this by executing
$> docker network ls
You are also missing a couple of labels for your services such as
traefik command line
- '--providers.docker.watch=true'
- '--providers.docker.swarmMode=true'
labels
- traefik.docker.network=proxy
- traefik.http.services.dev-releases-backend.loadbalancer.server.port=yourport
- traefik.http.routers.dev-releases-backend.service=mailcatcher
You can check this for more info