teampass server with docker-compose

 

docker-compose.yaml :

version: "3"
services:
  nginx:
    image: jwilder/nginx-proxy:alpine
    restart: always
    networks:
      - frontend
    ports:
      - "443:443"
      - "80:80"
    volumes:
      - ./volumes/ssl:/etc/nginx/certs
      - /var/run/docker.sock:/tmp/docker.sock:ro

  teampass:
    image: teampass/teampass
    restart: always
    environment:
      VIRTUAL_HOST: teampass.yourdomain.local
    networks:
      - frontend
      - backend
    volumes:
      - ./volumes/teampass:/var/www/html

  db:
    restart: always
    image: mysql/mysql-server:5.7
    environment:
      MYSQL_ROOT_PASSWORD: mypass
      MYSQL_DATABASE: teampass
      MYSQL_PASSWORD: teampass
      MYSQL_USER: teampass
    volumes:
      - ./volumes/db:/var/lib/mysql
    networks:
      - backend

networks:
  frontend:
  backend:

go to http://teampass.yourdomain.local/ complete the installation

Host: teampass_db_1
DataBase name : teampass
Login : teampass
Password : teampass
Port : 3306

login : admin password : yourpassword

##ldap problem, after teampass version 2.1.27, cannot use password expiry fuction (TeamPass 2.1.27.30 don’t need to do this)

vi /home/teampass/volumes/teampass/www/sources/identify.php

commented the following block of code: (TeamPass 2.1.27.30 don’t need to do this)

// if (is_array($adldap->user()->passwordExpiry($auth_username)) === false) {
// echo '[{"value" : "user_not_exists '.$auth_username.'", "text":""}]';
// exit();
// }

SSL :

vi docker-compose.yaml

version: "3"
services:
  nginx:
    image: jwilder/nginx-proxy:alpine
    restart: always
    networks:
      - frontend
    ports:
      - "443:443"
    volumes:
      - ./volumes/ssl:/etc/nginx/certs
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - ./volumes/teampass.conf:/etc/nginx/conf.d/teampass.conf

  teampass:
    image: teampass/teampass
    restart: always
    environment:
      VIRTUAL_HOST: teampass.yourdomain.local
    networks:
      - frontend
      - backend
    volumes:
      - ./volumes/teampass:/var/www/html

  db:
    restart: always
    image: mysql/mysql-server:5.7
    environment:
      MYSQL_ROOT_PASSWORD: mypass
      MYSQL_DATABASE: teampass
      MYSQL_PASSWORD: teampass
      MYSQL_USER: teampass
    volumes:
      - ./volumes/db:/var/lib/mysql
    networks:
      - backend

networks:
  frontend:
  backend:

vi teampass.conf

upstream teampass {
    server 192.168.0.5:80;
}

server {
    listen               443 ssl;
    server_name          teampass.yourdomain.local;

    ssl_certificate     /etc/nginx/certs/fullchain.pem;
    ssl_certificate_key /etc/nginx/certs/privkey.pem;

    location / {
                proxy_pass         http://teampass.yourdomain.local;
    }
}