Docker worker enhancement
* drops docker worker process in favor of background celery worker on main process * changes uploaded files folder into host-based folder
This commit is contained in:
		
							parent
							
								
									76e018e084
								
							
						
					
					
						commit
						460011a5e8
					
				@ -15,10 +15,11 @@ services:
 | 
			
		||||
      - arnova-nginx-server:arnova
 | 
			
		||||
    build: .
 | 
			
		||||
    container_name: "konova-docker"
 | 
			
		||||
    command: gunicorn konova.wsgi:application --bind 0.0.0.0:8000
 | 
			
		||||
    command: sh -c 'celery -A konova worker -l INFO --detach && gunicorn konova.wsgi:application --bind 0.0.0.0:8000'
 | 
			
		||||
    restart: always
 | 
			
		||||
    volumes:
 | 
			
		||||
      - .:/konova
 | 
			
		||||
      - konova_uploaded_files:/konova_uploaded_files
 | 
			
		||||
      - /path/to/host/folder:/konova_uploaded_files
 | 
			
		||||
      - static_file_volume:/konova/static  # Point to the volume for static files. Shared with nginx service
 | 
			
		||||
    expose:
 | 
			
		||||
      - 8000
 | 
			
		||||
@ -36,31 +37,6 @@ services:
 | 
			
		||||
      - SMTP_PORT=25
 | 
			
		||||
      - SMTP_REAL_REPLY_MAIL=ksp-servicestelle@sgdnord.rlp.de
 | 
			
		||||
 | 
			
		||||
# To provide a celery worker instance, we need to add the celery worker as an own service
 | 
			
		||||
  celery_worker:
 | 
			
		||||
    external_links:
 | 
			
		||||
      - postgis:db
 | 
			
		||||
      - arnova-nginx-server:arnova
 | 
			
		||||
    build: .
 | 
			
		||||
    container_name: "konova-worker-docker"
 | 
			
		||||
    command: celery -A konova worker -l INFO
 | 
			
		||||
    volumes:
 | 
			
		||||
      - .:/konova
 | 
			
		||||
      - konova_uploaded_files:/konova_uploaded_files
 | 
			
		||||
    depends_on:
 | 
			
		||||
      - konova
 | 
			
		||||
    environment:
 | 
			
		||||
      - POSTGRES_NAME=konova
 | 
			
		||||
      - POSTGRES_PORT=5432
 | 
			
		||||
      - POSTGRES_PASSWORD=CHANGE_ME
 | 
			
		||||
      - POSTGRES_USER=konova
 | 
			
		||||
      - POSTGRES_HOST=db
 | 
			
		||||
      - REDIS_HOST=redis
 | 
			
		||||
      - SSO_HOST=CHANGE_ME_TO_SSO_HOST_URL
 | 
			
		||||
      - SMTP_HOST=172.17.0.1
 | 
			
		||||
      - SMTP_PORT=25
 | 
			
		||||
      - SMTP_REAL_REPLY_MAIL=ksp-servicestelle@sgdnord.rlp.de
 | 
			
		||||
 | 
			
		||||
  nginx:
 | 
			
		||||
    build: ./nginx
 | 
			
		||||
    container_name: "konova-nginx-server"
 | 
			
		||||
@ -79,5 +55,4 @@ networks:
 | 
			
		||||
      name: postgis_nat_it_backend
 | 
			
		||||
 | 
			
		||||
volumes:
 | 
			
		||||
  static_file_volume:
 | 
			
		||||
  konova_uploaded_files:
 | 
			
		||||
  static_file_volume:
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user