0

I am having difficulty getting Wiki.js hosted on a server.

My current setup is using docker-compose utilising a reverse proxy with the eventual aim to host some services. I have successfully managed to host Portainer (using a guide). And I can host Wiki.js in its own docker container, but adding the service together is failing with a 502 error. Portainer is still working, however.

Here is the docker-compose.yml file:

version: '2'

services:

  proxy:
    image: jwilder/nginx-proxy
    container_name: proxy
    restart: unless-stopped
    labels:
      com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - certs:/etc/nginx/certs:rw
      - vhost.d:/etc/nginx/vhost.d
      - html:/usr/share/nginx/html
      - ./uploadsize.conf:/etc/nginx/conf.d/uploadsize.conf:ro
    ports:
      - "80:80"
      - "443:443"
    networks:
      - "default"
      - "proxy-tier"

  proxy-letsencrypt:
    image: jrcs/letsencrypt-nginx-proxy-companion
    container_name: letsencrypt
    restart: unless-stopped
    environment:
      - NGINX_PROXY_CONTAINER=proxy
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    volumes_from:
      - "proxy"
    depends_on:
      - "proxy"
    networks:
      - "default"
      - "proxy-tier"

  portainer:
    image: portainer/portainer
    container_name: portainer
    restart: always
    environment:
      - VIRTUAL_HOST=docker.example.com
      - LETSENCRYPT_HOST=docker.example.com
      - LETSENCRYPT_EMAIL=me@example.com
    volumes:
      - ./portainer/:/data
      - /var/run/docker.sock:/var/run/docker.sock
    ports:
      - "9000:9000"
## Wiki.js specific container (db)
  db:
    image: postgres:11-alpine
    container_name: wiki
    environment:
      POSTGRES_DB: wiki
      POSTGRES_PASSWORD: wikijsrocks
      POSTGRES_USER: wikijs
    logging:
      driver: "none"
    restart: unless-stopped
    volumes:
      - db-data:/var/lib/postgresql/data
## Wiki.js specific container (app)
  wiki:
    image: requarks/wiki:2
    depends_on:
      - db
    environment:
      DB_TYPE: postgres
      DB_HOST: db
      DB_PORT: 5432
      DB_USER: wikijs
      DB_PASS: wikijsrocks
      DB_NAME: wiki
      VIRTUAL_HOST: wiki.example.ml
      LETSENCRYPT_HOST: wiki.example.ml
      LETSENCRYPT_EMAIL: me@example.com
    restart: always
    ports:
      - "8010:3000" 

volumes:
  certs:
  vhost.d:
  html:
  db-data:

networks:
  proxy-tier:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.