Answer the question
In order to leave comments, you need to log in
Deploying a docker image based on a Django project. Where is the mistake?
Hello!
I'm trying to run a docker image I made.
dockerfile:
# Base Image
FROM python:3.6
# create and set working directory
RUN mkdir /app
WORKDIR /app
# Add current directory code to working directory
ADD . /app/
# set default environment variables
ENV PYTHONUNBUFFERED 1
ENV LANG C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
# set project environment variables
# grab these via Python's os.environ
# these are 100% optional here
ENV PORT=8000
#ENV DEBUG=0
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
tzdata \
python3-setuptools \
python3-pip \
python3-dev \
python3-venv \
git \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# install environment dependencies
RUN pip3 install --upgrade pip
RUN pip3 install pipenv
# Install project dependencies
RUN pipenv install --skip-lock --system --dev
EXPOSE 8888
CMD gunicorn Myapp.wsgi:application --bind 0.0.0.0:$PORT
Answer the question
In order to leave comments, you need to log in
Install gunicorn via apt:
RUN apt-get update && apt-get install -y --no-install-recommends \
gunicorn \
... \
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question