Home>

I do not really understand why it does not work.

dockerfile

From Python: 3.9-Alpine
Workdir /USR /SRC /APP /
Copy. USR /SRC /APP /
Expose 8088.
ENV Debug= 1
ENV SECRET_KEY= 1
ENV DB_NAME= Postgres
ENV DB_USER= Postgres
ENV DB_PASSWORD= 1
ENV DB_HOST= 0.0.0.0
RUN APK Add GCC Musl-Dev Python3-DeV Libffi-DeV OpenSSL-DEV Cargo
RUN APK Add Freetype-Dev Libjpeg-Turbo-Dev Libpng-Dev
RUN APK Add PostgreSQL-DEV
RUN PIP INSTALL --UPGRADE PIP
RUN APK Add Python3-Dev
RUN APK Add GCC
Run Pip Install -R Requirements.txt
EntryPoint ["sh", "initial.sh"]

docker-compose

Version: '3.9'
Services:
  DB:
    Image: Postgres: Latest
    Environment:
      Postgres_password: 1.
    Expose:
      -"5432"
    Ports:
      -"5432: 5432"
  Web:
    Build :.
# Command: Gunicorn Config.wsgi: Application --Bind 0.0.0.0:8088
    EntryPoint: ["sh", "startup.sh"]
    Expose:
      -"5432"
      -"8088"
    Ports:
      -"8888: 8088"
    DEPENDS_ON:
      -DB.

and final web service log

applying friendship.0003_block_unique_together ... ok
2021-08-19t12: 25: 57.503527839z Applying friendship.0004_auto_20200408_1844 ... OK
2021-08-19t12: 25: 57.503530298z Applying Sessions.0001_initial ... OK
2021-08-19t12: 25: 57.902563756Z Some Check Identified Some Issues:
2021-08-19t12: 25: 57.902612839z
2021-08-19T12: 25: 57.902615964Z Warnings:
2021-08-19t12: 25: 57.902617923z Account.Technology.user: (fields.w340) NULL HAS NO EFFECT ON MANYTOMANYFIELD.
2021-08-19T12: 25: 57.947482006Z Operations to Perform:
2021-08-19T12: 25: 57.947507214z Apply All Migrations: Account
2021-08-19T12: 25: 57.947510131Z Running Migrations:
2021-08-19T12: 25: 57.947515048Z No Migrations to Apply.
2021-08-19t12: 25: 58.119016590z [2021-08-19 12:25:58 +0000] [9] [info] Starting Gunicorn 20.1.0
2021-08-19t12: 25: 58.119171798z [2021-08-19 12:25:58 +0000] [9] [info] Listening AT: http://0.0.0:8888 (9)
2021-08-19T12: 25: 58.119183298Z [2021-08-19 12:25:58 +0000] [9] [info] using worker: sync
2021-08-19t12: 25: 58.121077548z [2021-08-19 12:25:58 +0000] [10] [info] Booting Worker With PID: 10

It seems to be the ports of the prokurata, Expose also do not understand why it does not work then

startup

Python Manage.py Migrate
Python Manage.py Migrate Account
Gunicorn Config.wsgi: Application --Bind 0.0.0.0:8888

Initial

PSQL Postgres -H 0.0.0.0 -D Postgres -f db.sql
Python Manage.py Migrate.
Python Manage.py Migrate Account
Python Manage.py Migrate Friendship 0001

Django DB

databases= {
'Default': {
    'Engine': 'django.db.backends.postgresql_psycopg2',
    'Name': 'postgres',
    'User': 'Postgres',
    'Password': '1',
    'HOST': 'DB',
    'Port': 5432
}}

To understand your models and scripts in EntryPoint

asanisimov2021-08-19 12:53:16

@asanisimov added, the most default models

BasicUser2021-08-19 12:57:54

You have account.technology.user: (fields.w340) NULL HAS NO EFFECT ON MANYTOMANYFIELD is interesting to implement your models, and I do not see the MakeMigations team? Maybe you and migration is not ready)

asanisimov2021-08-19 13:07:48

@asanisimov there is just NULL, locally works fine, just started in the container, I did not understand why it does not happen now

BasicUser2021-08-19 13:08:46

Try instead of Python Manage.py Migrate Python Manage.py Migrate Account This Python Manage.py MakeMigations Python Manage.py Migrate Account

asanisimov2021-08-19 13:09:08