Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker-compose.yml up -d not really quite there potentially. #15

Closed
Leopere opened this issue Jan 13, 2020 · 1 comment
Closed

docker-compose.yml up -d not really quite there potentially. #15

Leopere opened this issue Jan 13, 2020 · 1 comment

Comments

@Leopere
Copy link

@Leopere Leopere commented Jan 13, 2020

STDOUT logs

⇒  docker-compose kill && docker-compose rm -f && docker-compose up -d && docker-compose logs -f
Killing recipes_web_recipes_1 ... done
Killing recipes_db_recipes_1  ... done
Going to remove recipes_web_recipes_1, recipes_db_recipes_1
Removing recipes_web_recipes_1 ... done
Removing recipes_db_recipes_1  ... done
Creating recipes_db_recipes_1 ... done
Creating recipes_web_recipes_1 ... done
Attaching to recipes_web_recipes_1, recipes_db_recipes_1
db_recipes_1   | The files belonging to this database system will be owned by user "postgres".
db_recipes_1   | This user must also own the server process.
db_recipes_1   |
db_recipes_1   | The database cluster will be initialized with locale "en_US.utf8".
db_recipes_1   | The default database encoding has accordingly been set to "UTF8".
db_recipes_1   | The default text search configuration will be set to "english".
db_recipes_1   |
db_recipes_1   | Data page checksums are disabled.
db_recipes_1   |
db_recipes_1   | fixing permissions on existing directory /var/lib/postgresql/data ... ok
db_recipes_1   | creating subdirectories ... ok
db_recipes_1   | selecting default max_connections ... 100
db_recipes_1   | selecting default shared_buffers ... 128MB
db_recipes_1   | selecting default timezone ... UTC
db_recipes_1   | selecting dynamic shared memory implementation ... posix
db_recipes_1   | creating configuration files ... ok
db_recipes_1   | running bootstrap script ... ok
db_recipes_1   | sh: locale: not found
db_recipes_1   | 2020-01-13 23:29:15.818 UTC [28] WARNING:  no usable system locales were found
db_recipes_1   | performing post-bootstrap initialization ... ok
db_recipes_1   | syncing data to disk ... ok
db_recipes_1   |
db_recipes_1   | Success. You can now start the database server using:
db_recipes_1   |
db_recipes_1   | WARNING: enabling "trust" authentication for local connections
db_recipes_1   | You can change this by editing pg_hba.conf or using the option -A, or
db_recipes_1   | --auth-local and --auth-host, the next time you run initdb.
db_recipes_1   |
db_recipes_1   |     pg_ctl -D /var/lib/postgresql/data -l logfile start
db_recipes_1   |
db_recipes_1   | waiting for server to start....2020-01-13 23:29:18.638 UTC [33] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_recipes_1   | 2020-01-13 23:29:18.815 UTC [34] LOG:  database system was shut down at 2020-01-13 23:29:16 UTC
db_recipes_1   | 2020-01-13 23:29:18.841 UTC [33] LOG:  database system is ready to accept connections
db_recipes_1   |  done
db_recipes_1   | server started
db_recipes_1   | CREATE DATABASE
db_recipes_1   |
db_recipes_1   |
db_recipes_1   | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
db_recipes_1   |
db_recipes_1   | waiting for server to shut down....2020-01-13 23:29:19.646 UTC [33] LOG:  received fast shutdown request
db_recipes_1   | 2020-01-13 23:29:19.694 UTC [33] LOG:  aborting any active transactions
db_recipes_1   | 2020-01-13 23:29:19.695 UTC [33] LOG:  background worker "logical replication launcher" (PID 40) exited with exit code 1
db_recipes_1   | 2020-01-13 23:29:19.695 UTC [35] LOG:  shutting down
db_recipes_1   | 2020-01-13 23:29:20.195 UTC [33] LOG:  database system is shut down
db_recipes_1   |  done
db_recipes_1   | server stopped
db_recipes_1   |
db_recipes_1   | PostgreSQL init process complete; ready for start up.
db_recipes_1   |
db_recipes_1   | 2020-01-13 23:29:20.318 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
db_recipes_1   | 2020-01-13 23:29:20.318 UTC [1] LOG:  listening on IPv6 address "::", port 5432
db_recipes_1   | 2020-01-13 23:29:20.434 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_recipes_1   | 2020-01-13 23:29:20.676 UTC [44] LOG:  database system was shut down at 2020-01-13 23:29:20 UTC
db_recipes_1   | 2020-01-13 23:29:20.732 UTC [1] LOG:  database system is ready to accept connections
web_recipes_1  | [2020-01-13 23:29:20 +0000] [1] [INFO] Starting gunicorn 19.7.1
web_recipes_1  | [2020-01-13 23:29:20 +0000] [1] [INFO] Listening at: http://0.0.0.0:8080 (1)
web_recipes_1  | [2020-01-13 23:29:20 +0000] [1] [INFO] Using worker: sync
web_recipes_1  | [2020-01-13 23:29:20 +0000] [8] [INFO] Booting worker with pid: 8
web_recipes_1  | [2020-01-13 23:29:20 +0000] [8] [ERROR] Exception in worker process
web_recipes_1  | Traceback (most recent call last):
web_recipes_1  |   File "/usr/local/lib/python3.6/dist-packages/gunicorn/arbiter.py", line 578, in spawn_worker
web_recipes_1  |     worker.init_process()
web_recipes_1  |   File "/usr/local/lib/python3.6/dist-packages/gunicorn/workers/base.py", line 126, in init_process
web_recipes_1  |     self.load_wsgi()
web_recipes_1  |   File "/usr/local/lib/python3.6/dist-packages/gunicorn/workers/base.py", line 135, in load_wsgi
web_recipes_1  |     self.wsgi = self.app.wsgi()
web_recipes_1  |   File "/usr/local/lib/python3.6/dist-packages/gunicorn/app/base.py", line 67, in wsgi
web_recipes_1  |     self.callable = self.load()
web_recipes_1  |   File "/usr/local/lib/python3.6/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load
web_recipes_1  |     return self.load_wsgiapp()
web_recipes_1  |   File "/usr/local/lib/python3.6/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
web_recipes_1  |     return util.import_app(self.app_uri)
web_recipes_1  |   File "/usr/local/lib/python3.6/dist-packages/gunicorn/util.py", line 352, in import_app
web_recipes_1  |     __import__(module)
web_recipes_1  | ModuleNotFoundError: No module named 'recipes'
web_recipes_1  | [2020-01-13 23:29:20 +0000] [8] [INFO] Worker exiting (pid: 8)
web_recipes_1  | [2020-01-13 23:29:20 +0000] [1] [INFO] Shutting down: Master
web_recipes_1  | [2020-01-13 23:29:20 +0000] [1] [INFO] Reason: Worker failed to boot.
web_recipes_1  | [2020-01-13 23:29:25 +0000] [1] [INFO] Starting gunicorn 19.7.1
web_recipes_1  | [2020-01-13 23:29:25 +0000] [1] [INFO] Listening at: http://0.0.0.0:8080 (1)
web_recipes_1  | [2020-01-13 23:29:25 +0000] [1] [INFO] Using worker: sync
web_recipes_1  | [2020-01-13 23:29:25 +0000] [8] [INFO] Booting worker with pid: 8
web_recipes_1  | [2020-01-13 23:29:25 +0000] [8] [ERROR] Exception in worker process
web_recipes_1  | Traceback (most recent call last):
web_recipes_1  |   File "/usr/local/lib/python3.6/dist-packages/gunicorn/arbiter.py", line 578, in spawn_worker
web_recipes_1  |     worker.init_process()
web_recipes_1  |   File "/usr/local/lib/python3.6/dist-packages/gunicorn/workers/base.py", line 126, in init_process
web_recipes_1  |     self.load_wsgi()
web_recipes_1  |   File "/usr/local/lib/python3.6/dist-packages/gunicorn/workers/base.py", line 135, in load_wsgi
web_recipes_1  |     self.wsgi = self.app.wsgi()
web_recipes_1  |   File "/usr/local/lib/python3.6/dist-packages/gunicorn/app/base.py", line 67, in wsgi
web_recipes_1  |     self.callable = self.load()
web_recipes_1  |   File "/usr/local/lib/python3.6/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load
web_recipes_1  |     return self.load_wsgiapp()
web_recipes_1  |   File "/usr/local/lib/python3.6/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
web_recipes_1  |     return util.import_app(self.app_uri)
web_recipes_1  |   File "/usr/local/lib/python3.6/dist-packages/gunicorn/util.py", line 352, in import_app
web_recipes_1  |     __import__(module)
web_recipes_1  | ModuleNotFoundError: No module named 'recipes'
web_recipes_1  | [2020-01-13 23:29:25 +0000] [8] [INFO] Worker exiting (pid: 8)
web_recipes_1  | [2020-01-13 23:29:25 +0000] [1] [INFO] Shutting down: Master
web_recipes_1  | [2020-01-13 23:29:25 +0000] [1] [INFO] Reason: Worker failed to boot.

docker-compose.yml

version: "3"
services:
  db_recipes:
    restart: always
    image: "postgres:11-alpine"
    volumes:
    - ../../persist/db/recipes/:/var/lib/postgresql/data
    env_file:
    - ../../persist/config/recipes/env
    networks:
    - default

  web_recipes:
    build: .
    restart: always
    env_file:
    - ../../persist/config/recipes/env
    command: "gunicorn --bind 0.0.0.0:8080 recipes.wsgi"
    volumes:
    - ../../persist/db/data/:/Recipes
    depends_on:
    - db_recipes
    labels:
      - traefik.port=8080
      - traefik.frontend.rule=Host:recipes.EXAMPLE.com
      - "traefik.backend=recipes"
      - "traefik.docker.network=traefik"
      - "traefik.expose=true"
    networks:
      - traefik
      - default

  # nginx_recipes:
  #   image: "nginx"
  #   restart: always
  #   env_file:
  #   - ./.env
  #   volumes:
  #   - ./nginx/conf.d:/etc/nginx/conf.d
  #   - ./staticfiles:/static
  #   - ./mediafiles:/media
  #   networks:
  #   - default
  #   - nginx-proxy

networks:
  default:
  traefik:
    external: true
  # nginx-proxy:
  #   external:
  #     name: nginx-proxy

env

#VIRTUAL_HOST=
#LETSENCRYPT_HOST=
#LETSENCRYPT_EMAIL=

DEBUG=1
ALLOWED_HOSTS=*
SECRET_KEY=jWoHZyoZSwmjRR5jCTFDSMqneXEdFYzperDtDtxMVdBk5oYB3mnsfDw4VLyC35s

DB_ENGINE=django.db.backends.postgresql_psycopg2
POSTGRES_HOST=db_recipes
POSTGRES_PORT=5432
POSTGRES_USER=djangodb
POSTGRES_PASSWORD=djangodb
POSTGRES_DB=djangodb
@Leopere Leopere changed the title Gunicorn docker-compose.yml up -d not really quite there potentially. Jan 13, 2020
@Leopere

This comment has been minimized.

Copy link
Author

@Leopere Leopere commented Jan 13, 2020

Turns out in my attempt to separate state from the repository files I removed the app from the container.

@Leopere Leopere closed this Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.