Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

docker-compose not working #27

Open
changchichung opened this issue Sep 26, 2020 · 5 comments
Open

docker-compose not working #27

changchichung opened this issue Sep 26, 2020 · 5 comments

Comments

@changchichung
Copy link

docker-compose.yml in ubuntu
I change nothing here.

version: "3"
services:
  postal:
    #image: catdeployed/postal:ubuntu
    build: .
    container_name: postal
    command: run
    tty: true
    ports:
      - 127.0.0.1:25:25
    depends_on:
      - "mysql"
      - "rabbitmq"
    volumes:
#      - ./config/postal.yml:/opt/postal/config/postal.yml
      - persistent_assets:/storage
      - static_assets:/opt/postal/public
      - postal_assets:/opt/postal/public/assets
      - ./src/templates/:/templates
    environment:
      - MYSQL_ROOT_PASSWORD=changeme
      - MYSQL_DATABASE=postal
      - RABBITMQ_DEFAULT_USER=postal
      - RABBITMQ_DEFAULT_PASS=changeme
      - RABBITMQ_DEFAULT_VHOST=postal
      - POSTAL_FNAME=Sia
      - POSTAL_LNAME=Cat
      - POSTAL_PASSWORD=SecretCatPassword
      - POSTAL_EMAIL=myemail@catsworld.com
    healthcheck:
      test: curl -sS http://127.0.0.1:5000 || exit 1
      interval: 5s
      timeout: 10s
      retries: 3
  mysql:
    image: mariadb:10
    container_name: postal_mysql
    volumes:
      - mysql_data:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=changeme
      - MYSQL_DATABASE=postal
  rabbitmq:
    image: rabbitmq:3-alpine
    container_name: postal_rabbitmq
    environment:
      - RABBITMQ_DEFAULT_USER=postal
      - RABBITMQ_DEFAULT_PASS=changeme
      - RABBITMQ_DEFAULT_VHOST=/postal
  nginx:
    image: nginx
    container_name: postal_nginx
    ports:
      - 80:80
    links:
      - postal
    depends_on:
      - postal
    volumes:
      - ./src/nginx.conf:/etc/nginx/conf.d/default.conf:ro
      - static_assets:/opt/postal/public:ro
      - postal_assets:/opt/postal/public/assets:ro
volumes:
  persistent_assets:
  static_assets:
  postal_assets:
  mysql_data:

and docker logs postal

chchang@hqdc039:~/docker/docker-postal/ubuntu$ docker logs postal
== Waiting for MySQL and RabbitMQ to start up ==
2020/09/26 02:44:04 Waiting for: tcp://mysql:3306
2020/09/26 02:44:04 Waiting for: tcp://rabbitmq:5672
2020/09/26 02:44:04 Problem with dial: dial tcp 172.21.0.2:3306: connect: connection refused. Sleeping 1s
2020/09/26 02:44:04 Problem with dial: dial tcp 172.21.0.3:5672: connect: connection refused. Sleeping 1s
2020/09/26 02:44:05 Connected to tcp://mysql:3306
2020/09/26 02:44:05 Problem with dial: dial tcp 172.21.0.3:5672: connect: connection refused. Sleeping 1s
2020/09/26 02:44:06 Problem with dial: dial tcp 172.21.0.3:5672: connect: connection refused. Sleeping 1s
2020/09/26 02:44:07 Problem with dial: dial tcp 172.21.0.3:5672: connect: connection refused. Sleeping 1s
2020/09/26 02:44:08 Problem with dial: dial tcp 172.21.0.3:5672: connect: connection refused. Sleeping 1s
2020/09/26 02:44:09 Problem with dial: dial tcp 172.21.0.3:5672: connect: connection refused. Sleeping 1s
2020/09/26 02:44:10 Connected to tcp://rabbitmq:5672
02:44:11 system             | Procodile supervisor started with PID 35
02:44:11 system             | Application root is /opt/postal
02:44:11 system             | Automatic respawning is disabled
02:44:11 system             | Reloading configuration
02:44:11 control            | Listening at /tmp/postal/pids/procodile.sock
02:44:11 web.1              | Started with PID 38
02:44:11 worker.1           | Started with PID 40
02:44:11 cron.1             | Started with PID 42
02:44:11 smtp.1             | Started with PID 44
02:44:11 requeuer.1         | Started with PID 46
02:44:11 smtp.1             | => rake aborted!
02:44:11 smtp.1             | => Postal::ConfigError: No Let's Encrypt private key found at /opt/postal/config/lets_encrypt.pem
02:44:11 smtp.1             | => /opt/postal/lib/postal/config.rb:198:in `check_config!'
02:44:11 smtp.1             | => /opt/postal/config/boot.rb:9:in `<top (required)>'
02:44:11 smtp.1             | => /opt/postal/config/application.rb:1:in `require_relative'
02:44:11 smtp.1             | => /opt/postal/config/application.rb:1:in `<top (required)>'
02:44:11 smtp.1             | => /opt/postal/Rakefile:4:in `require_relative'
02:44:11 smtp.1             | => /opt/postal/Rakefile:4:in `<top (required)>'
02:44:11 smtp.1             | => /opt/postal/vendor/bundle/ruby/2.6.0/gems/rake-12.3.3/exe/rake:27:in `<top (required)>'
02:44:11 smtp.1             | => /usr/local/bundle/bin/bundle:23:in `load'
02:44:11 smtp.1             | => /usr/local/bundle/bin/bundle:23:in `<main>'
02:44:11 smtp.1             | => (See full trace by running task with --trace)
02:44:11 web.1              | => Puma starting in single mode...
02:44:11 web.1              | => * Version 4.3.5 (ruby 2.6.6-p146), codename: Mysterious Traveller
02:44:11 web.1              | => * Min threads: 5, max threads: 5
02:44:11 web.1              | => * Environment: production
02:44:11 web.1              | => ! Unable to load application: Postal::ConfigError: No Let's Encrypt private key found at /opt/postal/config/lets_encrypt.pem
02:44:11 web.1              | => bundler: failed to load command: puma (/opt/postal/vendor/bundle/ruby/2.6.0/bin/puma)
02:44:11 web.1              | => Postal::ConfigError: No Let's Encrypt private key found at /opt/postal/config/lets_encrypt.pem
02:44:11 web.1              | =>   /opt/postal/lib/postal/config.rb:198:in `check_config!'
02:44:11 web.1              | =>   /opt/postal/config/boot.rb:9:in `<top (required)>'
02:44:11 web.1              | =>   /opt/postal/config/application.rb:1:in `require_relative'
02:44:11 web.1              | =>   /opt/postal/config/application.rb:1:in `<top (required)>'
02:44:11 web.1              | =>   /opt/postal/config/environment.rb:2:in `require_relative'
02:44:11 web.1              | =>   /opt/postal/config/environment.rb:2:in `<top (required)>'
02:44:11 web.1              | =>   config.ru:3:in `require_relative'
02:44:11 web.1              | =>   config.ru:3:in `block in <main>'
02:44:11 web.1              | =>   /opt/postal/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in `eval'
02:44:11 web.1              | =>   /opt/postal/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in `new_from_string'
02:44:11 web.1              | =>   /opt/postal/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/builder.rb:105:in `load_file'
02:44:11 web.1              | =>   /opt/postal/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/builder.rb:66:in `parse_file'
02:44:11 web.1              | =>   /opt/postal/vendor/bundle/ruby/2.6.0/gems/puma-4.3.5/lib/puma/configuration.rb:321:in `load_rackup'
02:44:11 web.1              | =>   /opt/postal/vendor/bundle/ruby/2.6.0/gems/puma-4.3.5/lib/puma/configuration.rb:246:in `app'
02:44:11 web.1              | =>   /opt/postal/vendor/bundle/ruby/2.6.0/gems/puma-4.3.5/lib/puma/runner.rb:155:in `load_and_bind'
02:44:11 web.1              | =>   /opt/postal/vendor/bundle/ruby/2.6.0/gems/puma-4.3.5/lib/puma/single.rb:98:in `run'
02:44:11 web.1              | =>   /opt/postal/vendor/bundle/ruby/2.6.0/gems/puma-4.3.5/lib/puma/launcher.rb:172:in `run'
02:44:11 web.1              | =>   /opt/postal/vendor/bundle/ruby/2.6.0/gems/puma-4.3.5/lib/puma/cli.rb:80:in `run'
02:44:11 web.1              | =>   /opt/postal/vendor/bundle/ruby/2.6.0/gems/puma-4.3.5/bin/puma:10:in `<top (required)>'
02:44:11 web.1              | =>   /opt/postal/vendor/bundle/ruby/2.6.0/bin/puma:23:in `load'
02:44:11 web.1              | =>   /opt/postal/vendor/bundle/ruby/2.6.0/bin/puma:23:in `<top (required)>'
02:44:11 worker.1           | => /opt/postal/lib/postal/config.rb:198:in `check_config!': No Let's Encrypt private key found at /opt/postal/config/lets_encrypt.pem (Postal::ConfigError)
02:44:11 worker.1           | => 	from /opt/postal/config/boot.rb:9:in `<top (required)>'
02:44:11 worker.1           | => 	from /opt/postal/config/application.rb:1:in `require_relative'
02:44:11 worker.1           | => 	from /opt/postal/config/application.rb:1:in `<top (required)>'
02:44:11 worker.1           | => 	from /opt/postal/config/environment.rb:2:in `require_relative'
02:44:11 worker.1           | => 	from /opt/postal/config/environment.rb:2:in `<top (required)>'
02:44:11 worker.1           | => 	from script/worker.rb:2:in `require_relative'
02:44:11 worker.1           | => 	from script/worker.rb:2:in `<main>'
02:44:11 cron.1             | => rake aborted!
02:44:11 cron.1             | => Postal::ConfigError: No Let's Encrypt private key found at /opt/postal/config/lets_encrypt.pem
02:44:11 cron.1             | => /opt/postal/lib/postal/config.rb:198:in `check_config!'
02:44:11 cron.1             | => /opt/postal/config/boot.rb:9:in `<top (required)>'
02:44:11 cron.1             | => /opt/postal/config/application.rb:1:in `require_relative'
02:44:11 cron.1             | => /opt/postal/config/application.rb:1:in `<top (required)>'
02:44:11 cron.1             | => /opt/postal/Rakefile:4:in `require_relative'
02:44:11 cron.1             | => /opt/postal/Rakefile:4:in `<top (required)>'
02:44:11 cron.1             | => /opt/postal/vendor/bundle/ruby/2.6.0/gems/rake-12.3.3/exe/rake:27:in `<top (required)>'
02:44:11 cron.1             | => /usr/local/bundle/bin/bundle:23:in `load'
02:44:11 cron.1             | => /usr/local/bundle/bin/bundle:23:in `<main>'
02:44:11 cron.1             | => (See full trace by running task with --trace)
02:44:11 requeuer.1         | => rake aborted!
02:44:11 requeuer.1         | => Postal::ConfigError: No Let's Encrypt private key found at /opt/postal/config/lets_encrypt.pem
02:44:11 requeuer.1         | => /opt/postal/lib/postal/config.rb:198:in `check_config!'
02:44:11 requeuer.1         | => /opt/postal/config/boot.rb:9:in `<top (required)>'
02:44:11 requeuer.1         | => /opt/postal/config/application.rb:1:in `require_relative'
02:44:11 requeuer.1         | => /opt/postal/config/application.rb:1:in `<top (required)>'
02:44:11 requeuer.1         | => /opt/postal/Rakefile:4:in `require_relative'
02:44:11 requeuer.1         | => /opt/postal/Rakefile:4:in `<top (required)>'
02:44:11 requeuer.1         | => /opt/postal/vendor/bundle/ruby/2.6.0/gems/rake-12.3.3/exe/rake:27:in `<top (required)>'
02:44:11 requeuer.1         | => /usr/local/bundle/bin/bundle:23:in `load'
02:44:11 requeuer.1         | => /usr/local/bundle/bin/bundle:23:in `<main>'
02:44:11 requeuer.1         | => (See full trace by running task with --trace)
02:44:14 web.1              | Process has stopped. Respawning not available.
02:44:14 web.1              | Removed PID file
02:44:14 worker.1           | Process has stopped. Respawning not available.
02:44:14 worker.1           | Removed PID file
02:44:14 cron.1             | Process has stopped. Respawning not available.
02:44:14 cron.1             | Removed PID file
02:44:14 smtp.1             | Process has stopped. Respawning not available.
02:44:14 smtp.1             | Removed PID file
02:44:14 requeuer.1         | Process has stopped. Respawning not available.
02:44:14 requeuer.1         | Removed PID file
02:44:14 system             | All processes have stopped
02:44:14 system             | Stopping Procodile supervisor

please , any suggestions ?

@Pfannkuchensack
Copy link

have the same prob
It is "Postal::ConfigError: No Let's Encrypt private key found at /opt/postal/config/lets_encrypt.pem"
he cant find this file.

@Pfannkuchensack
Copy link

Workaround:

docker exec -it postal bash
/opt/postal/bin/postal make_user

Then fill out the fields and the user ist created

@iot-resister
Copy link

iot-resister commented Oct 31, 2020

I'm not using ngnix as it works fine without it. This is the offending line

 - persistent_assets:/storage

removed it and the error went away.

@hezten
Copy link

hezten commented Dec 21, 2020

Workaround:

docker exec -it postal bash
/opt/postal/bin/postal make_user

Then fill out the fields and the user ist created

There is no command called make_user. Running the correct make-user give this error

root@a212ba745a55:/# /opt/postal/bin/postal make-user
Traceback (most recent call last):
7: from script/make_user.rb:4:in <main>' 6: from script/make_user.rb:4:in require_relative'
5: from /opt/postal/config/environment.rb:2:in <top (required)>' 4: from /opt/postal/config/environment.rb:2:in require_relative'
3: from /opt/postal/config/application.rb:1:in <top (required)>' 2: from /opt/postal/config/application.rb:1:in require_relative'
1: from /opt/postal/config/boot.rb:9:in <top (required)>' /opt/postal/lib/postal/config.rb:198:in check_config!': No Let's Encrypt private key found at /opt/postal/config/lets_encrypt.pem (Postal::ConfigError)

So it does in way solve the error.

@xZero707
Copy link

xZero707 commented May 27, 2021

Seems like your install might be broken.

You can use docker-compose for clean reinstall, but make sure to backup your Postal files beforehand.

BEWARE: The following command will take down all associated services and volumes. All Postal data will be LOST! So backup first!

docker-compose down -v

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants