Below is my Error message and docker-compose.yml file.
I am trying to run 3 Django Projects as Services which handles services like Printing, Inspection,etc… as you can see in .yml file when I am building it.
The Problems that i am facing is
- It only catches the cartonprintingsystem manage.py and it skips the file of other services and it happens for Dockerfile,requirements.txt as well. How to handle this issue.
- I tried to manual create manage.py for inspection and I think it does not copies the manage.py file of other services that why it giving me this error.
# python manage_inspection.py makemigrations
System check identified some issues:
WARNINGS:
inspectionactivity.SesUser.session_number: (fields.W122) 'max_length' is ignored when used with BigIntegerField.
HINT: Remove 'max_length' from field
Traceback (most recent call last):
File "/app/manage_inspection.py", line 22, in <module>
main()
File "/app/manage_inspection.py", line 18, in main
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 412, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 458, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 106, in wrapper
res = handle_func(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/django/core/management/commands/makemigrations.py", line 156, in handle
loader.check_consistent_history(connection)
File "/usr/local/lib/python3.9/site-packages/django/db/migrations/loader.py", line 327, in check_consistent_history
raise InconsistentMigrationHistory(
django.db.migrations.exceptions.InconsistentMigrationHistory: Migration admin.0001_initial is applied before its dependency inspectionactivity.0001_initial on database 'default'```
version: '3.8'
services:
cartonprintingsystem:
build:
context: ./cartonprintingsystem
dockerfile: Dockerfile
command: python manage.py runserver 0.0.0.0:8000
ports:
- "8000:8000"
# volumes:
# - ./cartonprintingsystem:/app
volumes:
- carton-printing-volume:/app
networks:
- Carton
inspection_service:
build:
context: ./inspection_service
dockerfile: Dockerfile
command: python manage.py runserver 0.0.0.0:8001
ports:
- "8001:8001"
volumes:
- carton-printing-volume:/app
environment:
- DJANGO_SETTINGS_MODULE=inspection_service.settings
networks:
- Carton
printing_service:
build:
context: ./printing
dockerfile: Dockerfile
command: python manage.py runserver 0.0.0.0:8002
ports:
- "8002:8002"
volumes:
- carton-printing-volume:/app
networks:
- Carton
phpMyAdmin:
image: phpmyadmin
environment:
PMA_ARBITRARY: 1
ports:
- "9090:80"
broker:
image: confluentinc/cp-kafka:7.5.0
container_name: broker
ports:
- "9092:9092"
environment:
KAFKA_BROKER_ID: 1
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://broker:29092,PLAINTEXT_HOST://localhost:9092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_PROCESS_ROLES: broker,controller
KAFKA_NODE_ID: 1
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@broker:29093
KAFKA_LISTENERS: PLAINTEXT://broker:29092,CONTROLLER://broker:29093,PLAINTEXT_HOST://0.0.0.0:9092
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_LOG_DIRS: /tmp/kraft-combined-logs
CLUSTER_ID: MkU3OEVBNTcwNTJENDM2Qk
networks:
- Carton
volumes:
carton-printing-volume:
networks:
Carton: