<p>I'm looking to deploy a simple application which uses Django and celery.</p>
<p>docker-compose.yml:</p>
<pre><code>version: &quot;3.8&quot;
   
services:
    django:
        build: .
        container_name: django
        command: python manage.py runserver 0.0.0.0:8000
        volumes:
            - .:/usr/src/app/
        ports:
            - &quot;8000:8000&quot;
        environment:
            - DEBUG=1
            - CELERY_BROKER=redis://redis:6379/0
            - CELERY_BACKEND=djcelery.backends.database:DatabaseBackend
        depends_on:
            - redis
    celery:
        build: .
        command: celery -A core worker -l INFO
        volumes:
            - .:/usr/src/app
        environment:
            - DEBUG=1
            - CELERY_BROKER=redis://redis:6379/0
            - CELERY_BACKEND=djcelery.backends.database:DatabaseBackend
        depends_on:
            - django
            - redis
    redis:
        image: &quot;redis:alpine&quot;
        
volumes:
    pgdata:


</code></pre>
<p>Dockerfile:</p>
<pre><code>FROM python:3.7
WORKDIR /app
ADD . /app

#Install dependencies for PyODBC
RUN apt-get update \
 &amp;&amp; apt-get install unixodbc -y \
 &amp;&amp; apt-get install unixodbc-dev -y \
 &amp;&amp; apt-get install tdsodbc -y \
 &amp;&amp; apt-get clean -y


# install ODBC driver in docker image
RUN apt-get update \
 &amp;&amp; curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
 &amp;&amp; curl https://packages.microsoft.com/config/debian/10/prod.list &gt; /etc/apt/sources.list.d/mssql-release.list \
 &amp;&amp; apt-get update \
 &amp;&amp; ACCEPT_EULA=Y apt-get install --yes --no-install-recommends msodbcsql17 \
 &amp;&amp; apt-get clean \
 &amp;&amp; rm -rf /var/lib/apt/lists/* \
 &amp;&amp; rm -rf /tmp/*


# install requirements
RUN pip install --trusted-host pypi.python.org -r requirements.txt
EXPOSE 5000

ENV NAME OpentoAll

CMD [&quot;python&quot;, &quot;app.py&quot;]

</code></pre>
<p>Project Directories:
<a href="https://i.stack.imgur.com/aibPR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aibPR.png" alt="enter image description here" /></a></p>
<p>When I run &quot;docker-compose up&quot; locally, the celery worker is run and I am able to go to localhost:8000 to access the API to make asynchronous requests to a celery task.</p>
<p>Now I'm wondering how can I deploy this to the cloud environment? What would be the image I would need to build and deploy? Thanks</p>

Allen Wu
<p>You will need to install an application server (eg. gunicorn) in your django container and then run it on say port 8000. You'll also need a webserver (eg. nginx) in a container or installed on the host. The web server will need to act as a reverse proxy for gunicorn and also serve your static Django content.</p>
