Azure Web App with multi container(docker compose)
am attempting to deploy Label Studio to an Azure Web App using Docker Compose. The application repository can be found here: Label Studio GitHub Repository.
Deployment Setup
To support the application, I need to use a PostgreSQL database. Consequently, I have created a docker-compose.yml
file to orchestrate both Label Studio and PostgreSQL services. This setup requires an external storage solution, necessitating a second Dockerfile specifically for PostgreSQL.
Issue Description
When I deploy using the custom PostgreSQL Dockerfile, the deployment process fails from the start, and the logs do not provide any indication of the underlying issue.
Configuration Details
- Docker Compose File: Utilizes both the Label Studio Dockerfile and a custom PostgreSQL Dockerfile.
- PostgreSQL Dockerfile: Custom Dockerfile created to set up the PostgreSQL service.
- Azure Web App: Deployment target for the Docker Compose configuration.
Request for Assistance
Could you please assist me in troubleshooting this issue? Specifically:
- Log Insights: Any guidance on how to obtain more detailed logs or error messages to diagnose the failure.
- Configuration Review: Help in reviewing the Docker Compose setup and Dockerfiles to ensure they are correctly configured for Azure Web App deployment.
- Deployment Best Practices: Advice on best practices for deploying multi-container applications with external storage on Azure Web Apps.
Thank you for your support. am attempting to deploy Label Studio to an Azure Web App using Docker Compose. The application repository can be found here: Label Studio GitHub Repository.
Deployment Setup
To support the application, I need to use a PostgreSQL database. Consequently, I have created a docker-compose.yml
file to orchestrate both Label Studio and PostgreSQL services. This setup requires an external storage solution, necessitating a second Dockerfile specifically for PostgreSQL.
Issue Description
When I deploy using the custom PostgreSQL Dockerfile, the deployment process fails from the start, and the logs do not provide any indication of the underlying issue.
Configuration Details
- Docker Compose File: Utilizes both the Label Studio Dockerfile and a custom PostgreSQL Dockerfile.
- PostgreSQL Dockerfile: Custom Dockerfile created to set up the PostgreSQL service.
- Azure Web App: Deployment target for the Docker Compose configuration.
Request for Assistance
Could you please assist me in troubleshooting this issue? Specifically:
- Log Insights: Any guidance on how to obtain more detailed logs or error messages to diagnose the failure.
- Configuration Review: Help in reviewing the Docker Compose setup and Dockerfiles to ensure they are correctly configured for Azure Web App deployment.
- Deployment Best Practices: Advice on best practices for deploying multi-container applications with external storage on Azure Web Apps.
Thank you for your support.
services:
nginx:
build: .
image: heartexlabs/label-studio:latest
restart: unless-stopped
ports:
- "8080:8085"
- "8081:8086"
depends_on:
- app
environment:
- LABEL_STUDIO_HOST=https://app-client-labeling-dev2.azurewebsites.net
# Optional: Specify SSL termination certificate & key
# Just drop your cert.pem and cert.key into folder 'deploy/nginx/certs'
# - NGINX_SSL_CERT=/certs/cert.pem
# - NGINX_SSL_CERT_KEY=/certs/cert.key
volumes:
- ./mydata:/label-studio/data:rw
- ./deploy/nginx/certs:/certs:ro
# Optional: Override nginx default conf
# - ./deploy/my.conf:/etc/nginx/nginx.conf
command: nginx
networks:
- app-network
app:
stdin_open: true
tty: true
build: .
image: heartexlabs/label-studio:latest
restart: unless-stopped
expose:
- "8000"
depends_on:
- db
environment:
- DJANGO_DB=default
- POSTGRE_NAME=postgres
- POSTGRE_USER=postgres
- POSTGRE_PASSWORD=popopo12
- POSTGRE_PORT=5432
- POSTGRE_HOST=db
- LABEL_STUDIO_HOST=https://app-client-labeling-dev2.azurewebsites.net
- JSON_LOG=1
- LOG_LEVEL=DEBUG
volumes:
- ./mydata:/label-studio/data:rw
command: label-studio-uwsgi
networks:
- app-network
db:
build:
context: .
dockerfile: Dockerfile.postgres
#image: postgres:11.5
hostname: db
restart: unless-stopped
# Optional: Enable TLS on PostgreSQL
# Just drop your server.crt and server.key into folder 'deploy/pgsql/certs'
# NOTE: Both files must have permissions u=rw (0600) or less
# command: >
# -c ssl=on
# -c ssl_cert_file=/var/lib/postgresql/certs/server.crt
# -c ssl_key_file=/var/lib/postgresql/certs/server.key
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
volumes:
- postgres-data:/var/lib/postgresql/data
#- ${POSTGRES_DATA_DIR:-./postgres-data}:/var/lib/postgresql/data
- ./deploy/pgsql/certs:/var/lib/postgresql/certs:ro
#entrypoint: ["/deploy/init-postgres.sh"]
networks:
- app-network
volumes:
mydata:
external: true
certs:
driver: azurefile
driver_opts:
share_name: ptsd
storage_account_name: pstgls
storage_account_key: WvD3VsoczRN8bJyKpt/LUxHulDKQSoTJ5R4c8fhotX0VRyrG3MT9fo1/lMMxr6UGifecwYnVsZQM+AStS9JWsw==>
postgres-data:
external: true
networks:
app-network:
driver: bridge