Trying to host my Django app on Azure however I received the following errors. I also have an sqlite database but I dont think that causes the error if I'm not mistaken. I have set the DOCKER_REGISTRY... within Azure config to match those of my Docker account, is that correct?
Azure has confirmed the below is successful:
I have tried the following from here, here, here and here. I thought the issue was to do with the exposed ports set within docker file or within the apps settings.py file.
settings.py snippets
ALLOWED_HOSTS = ['.herokuapp.com', 'localhost', '127.0.0.1', 'shawjournal.azurewebsites.net']
WEBSITES_PORT=80
PORT=9000
dockerfile
# Pull base image
FROM python:3.8
EXPOSE 80
EXPOSE 443
EXPOSE 9000
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Set work directory
WORKDIR /code
# Install dependencies
COPY Pipfile Pipfile.lock /code/
RUN pip install pipenv && pipenv install --system
# Copy project
COPY . /code/
CMD ["python", "/code/manage.py", "runserver", "0.0.0.0:8000"]
docker-compose.yml
version: '3.8'
services:
web:
build: .
command: python /code/manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- 8000:8000
Thanks!