standardnotes / server

Server ecosystem for Standard Notes; fully self-hostable.
https://standardnotes.com/help/self-hosting/docker
GNU General Public License v3.0
236 stars 57 forks source link

Unable to setup using docker compose #1061

Open thinkloop opened 1 month ago

thinkloop commented 1 month ago

Hello, I followed the instructions to self-host Standard Notes using the instructions here: https://standardnotes.com/help/self-hosting/docker

However I am unable to load the service at http://nas.example.com:3000/ where I expect it.

When I start docker and tail the main server service I get these logs:

root@nas:/mnt/docker-data# docker compose down standard-notes-server; docker compose up standard-notes-server -d; docker compose logs standard-notes-server -f;
WARN[0000] /mnt/docker-data/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion
[+] Running 2/1
 ✔ Container server_self_hosted       Removed                                                                                                                                                                               10.4s
 ! Network standardnotes_self_hosted  Resource is still in use                                                                                                                                                               0.0s
WARN[0000] /mnt/docker-data/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion
[+] Running 1/1
 ✔ Container server_self_hosted  Started                                                                                                                                                                                     0.3s
WARN[0000] /mnt/docker-data/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion
server_self_hosted  | 2024-07-26 04:24:57,621 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as root, you can set user=root in the config file to avoid this message.
server_self_hosted  | 2024-07-26 04:24:57,623 INFO supervisord started with pid 24
server_self_hosted  | 2024-07-26 04:24:58,628 INFO spawned: 'api-gateway' with pid 25
server_self_hosted  | 2024-07-26 04:24:58,632 INFO spawned: 'auth' with pid 26
server_self_hosted  | 2024-07-26 04:24:58,635 INFO spawned: 'auth-worker' with pid 27
server_self_hosted  | 2024-07-26 04:24:58,638 INFO spawned: 'files' with pid 28
server_self_hosted  | 2024-07-26 04:24:58,640 INFO spawned: 'files-worker' with pid 31
server_self_hosted  | 2024-07-26 04:24:58,642 INFO spawned: 'revisions' with pid 34
server_self_hosted  | 2024-07-26 04:24:58,644 INFO spawned: 'revisions-worker' with pid 38
server_self_hosted  | 2024-07-26 04:24:58,646 INFO spawned: 'syncing-server' with pid 43
server_self_hosted  | 2024-07-26 04:24:58,648 INFO spawned: 'syncing-server-worker' with pid 45
server_self_hosted  | 2024-07-26 04:24:59,656 INFO success: api-gateway entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
server_self_hosted  | 2024-07-26 04:24:59,656 INFO success: auth entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
server_self_hosted  | 2024-07-26 04:24:59,656 INFO success: auth-worker entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
server_self_hosted  | 2024-07-26 04:24:59,656 INFO success: files entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
server_self_hosted  | 2024-07-26 04:24:59,656 INFO success: files-worker entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
server_self_hosted  | 2024-07-26 04:24:59,657 INFO success: revisions entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
server_self_hosted  | 2024-07-26 04:24:59,657 INFO success: revisions-worker entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
server_self_hosted  | 2024-07-26 04:24:59,657 INFO success: syncing-server entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
server_self_hosted  | 2024-07-26 04:24:59,657 INFO success: syncing-server-worker entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

My .env file is as specified in the instructions with the db password and last 3 keys filled in:

######
# DB #
######

DB_HOST=db
DB_PORT=3306
DB_USERNAME=std_notes_user
DB_PASSWORD=[CHANGED_PASSWORD]
DB_DATABASE=standard_notes_db
DB_TYPE=mysql

#########
# CACHE #
#########

REDIS_PORT=6379
REDIS_HOST=cache
CACHE_TYPE=redis

########
# KEYS #
########

AUTH_JWT_SECRET=[HEX_KEY_1]
AUTH_SERVER_ENCRYPTION_SERVER_KEY=[HEX_KEY_2]
VALET_TOKEN_SECRET=[HEX_KEY_3]

My docker compose file is as specified with some services renamed and paths changed since it is part of a larger docker deployment:

version: '3.9'
services:

  [OTHER_SERVICES_BEFORE_STANDARD_NOTES]

  standard-notes-server:
    image: standardnotes/server
    env_file: /mnt/docker-data/standard-notes/.env
    container_name: server_self_hosted
    restart: unless-stopped
    ports:
      - 3000:3000
      - 3125:3104
    volumes:
      - /mnt/docker-data/standard-notes/logs:/var/lib/server/logs
      - /mnt/docker-data/standard-notes/uploads:/opt/server/packages/files/dist/uploads
    networks:
      - standardnotes_self_hosted

  standard-notes-localstack:
    image: localstack/localstack:3.0
    container_name: localstack_self_hosted
    expose:
      - 4566
    restart: unless-stopped
    environment:
      - SERVICES=sns,sqs
      - HOSTNAME_EXTERNAL=localstack
      - LS_LOG=warn
    volumes:
      - /mnt/docker-data/standard-notes/localstack_bootstrap.sh:/etc/localstack/init/ready.d/localstack_bootstrap.sh
    networks:
      - standardnotes_self_hosted

  standard-notes-db:
    image: mysql:8
    container_name: db_self_hosted
    environment:
      - MYSQL_DATABASE=standard_notes_db
      - MYSQL_USER=std_notes_user
      - MYSQL_ROOT_PASSWORD=[CHANGED_PASSWORD]
      - MYSQL_PASSWORD=[CHANGED_PASSWORD]
    expose:
      - 3306
    restart: unless-stopped
    volumes:
      - /mnt/docker-data/standard-notes/data/mysql:/var/lib/mysql
      - /mnt/docker-data/standard-notes/data/import:/docker-entrypoint-initdb.d
    networks:
      - standardnotes_self_hosted

  standard-notes-cache:
    image: redis:6.0-alpine
    container_name: cache_self_hosted
    volumes:
      - /mnt/docker-data/standard-notes/data/redis/:/data
    expose:
      - 6379
    restart: unless-stopped
    networks:
      - standardnotes_self_hosted

networks:
  seafile-net:
  standardnotes_self_hosted:
    name: standardnotes_self_hosted

Any hints on what's going wrong or where I can look to find error messages?

Thanks!

alexchiri commented 1 month ago

@thinkloop Have you checked the logs in your standard-notes-server container at var/lib/server/logs. They should give you some hints with what is wrong.

CarlSinclair commented 1 month ago

Same issue. All faillogs and lastlogs in /var/lib/containers/storage/overlay/*/*/var/log are empty, and dpkg logs and alternatives logs offer no hints. history logs are all equally unhelpful.