Skip to content

Instantly share code, notes, and snippets.

@mazz
Created January 27, 2020 02:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mazz/faf20189eafa476617c2b0f2e554d39a to your computer and use it in GitHub Desktop.
Save mazz/faf20189eafa476617c2b0f2e554d39a to your computer and use it in GitHub Desktop.
version: '3.7'
services:
proxy:
image: traefik:v2.1
container_name: traefik
restart: unless-stopped
security_opt:
- no-new-privileges:true
networks:
- proxy-network
ports:
- 80:80
- 443:443
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./docker/traefik.yml:/traefik.yml:ro
- ./docker/acme.json:/acme.json
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik.entrypoints=http"
- "traefik.http.routers.traefik.rule=Host(`proxy.objectaaron.com`)"
- "traefik.http.middlewares.traefik-auth.basicauth.users=admin:$apr1$se9V4kJV$WK3Tl27Rf1UKJs1JkOXQQ1"
- "traefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.traefik.middlewares=traefik-https-redirect"
- "traefik.http.routers.traefik-secure.entrypoints=https"
- "traefik.http.routers.traefik-secure.rule=Host(`proxy.objectaaron.com`)"
- "traefik.http.routers.traefik-secure.middlewares=traefik-auth"
- "traefik.http.routers.traefik-secure.tls=true"
- "traefik.http.routers.traefik-secure.tls.certresolver=http"
- "traefik.http.routers.traefik-secure.service=api@internal"
postgres:
image: postgres:12.1-alpine
environment:
POSTGRES_DB: ${FW_DATABASE_NAME?Variable FW_DATABASE_NAME not set}
POSTGRES_PASSWORD: ${FW_DATABASE_PASSWORD?Variable FW_DATABASE_PASSWORD not set}
POSTGRES_USER: ${FW_DATABASE_USERNAME?Variable FW_DATABASE_USERNAME not set}
networks:
- db-network
volumes:
- database-storage:/var/lib/postgresql/data
faithful_word_umbrella:
container_name: faithful_word_umbrella
restart: unless-stopped
build: .
image: faithful_word_umbrella
ports:
- '4000:4000'
env_file:
- .faithful_word_umbrella_env
depends_on:
- proxy
- postgres
networks:
- db-network
- proxy-network
labels:
- "traefik.enable=true"
- "traefik.port=4000"
- "traefik.http.routers.faithful_word_umbrella.entrypoints=http"
- "traefik.http.routers.faithful_word_umbrella.rule=Host(`${DOMAIN?Variable DOMAIN not set}`)"
- "traefik.http.middlewares.faithful_word_umbrella-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.faithful_word_umbrella.middlewares=faithful_word_umbrella-https-redirect"
- "traefik.http.routers.faithful_word_umbrella-secure.entrypoints=https"
- "traefik.http.routers.faithful_word_umbrella-secure.rule=Host(`${DOMAIN?Variable DOMAIN not set}`)"
- "traefik.http.routers.faithful_word_umbrella-secure.tls=true"
- "traefik.http.routers.faithful_word_umbrella-secure.tls.certresolver=http"
- "traefik.http.routers.faithful_word_umbrella-secure.service=faithful_word_umbrella"
- "traefik.http.services.faithful_word_umbrella.loadbalancer.server.port=4000"
- "traefik.docker.network=proxy-network"
networks:
db-network:
proxy-network:
external: true
volumes:
proxy-certificates-storage:
database-storage:
@mazz
Copy link
Author

mazz commented Jan 27, 2020

traefik                   | 2020/01/27 01:53:36 command traefik error: yaml: line 3: did not find expected key
traefik exited with code 1
traefik                   | 2020/01/27 01:53:42 command traefik error: yaml: line 3: did not find expected key
traefik exited with code 1
traefik                   | 2020/01/27 01:53:50 command traefik error: yaml: line 3: did not find expected key
traefik exited with code 1

@tlex
Copy link

tlex commented Jan 27, 2020

Your error is in ./docker/traefik.yml, not in the compose file. Basically, the services start just fine and traefik then can't parse the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment