This is a newer version of Getting my Confluence in Docker

Preparing

groupadd -g 2002 confluence
sudo useradd -u 2002 -g 2002 confluence
chown -R confluence:confluence /data/confluence-home
chown -R confluence:confluence /data/confluence-ext-libs


My docker-compose file (that also covers postgres):

version: '3.4'
services:
  confluence:
    image: atlassian/confluence
    ports:
      - 8090:8090
    environment:
      - ATL_DB_TYPE=postgresql
      - ATL_PROXY_NAME=www.mos-eisley.dk
      - ATL_PROXY_PORT=443
      - ATL_TOMCAT_SCHEME=https
      - JVM_MAXIMUM_MEMORY=3072m
      - JVM_RESERVED_CODE_CACHE_SIZE=512m
      - ATL_TOMCAT_ACCESS_LOGS_MAXDAYS=3
    volumes:
      - /data/confluence-home:/var/atlassian/application-data/confluence
      - /data/images:/opt/atlassian/confluence/confluence/media
      - /data/confluence-ext-libs:/opt/atlassian/confluence/confluence/confluence-ext-libs
      - /data/filecontent:/opt/atlassian/confluence/confluence/filecontent
    depends_on:
    - postgres
  postgres:
    image: docker.io/postgres:10.13
    ports:
      - 5432:5432
    environment:
      - POSTGRES_PASSWORD=********
      - PGDATA=/var/lib/postgresql/data/pgdata
    volumes:
    - /opt/pgdata:/var/lib/postgresql/data