상세 컨텐츠

본문 제목

Django with Docker

Django

by BenzhaminKim 2021. 1. 15. 11:03

본문

# 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

# 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 cfehome.wsgi:application --bind 0.0.0.0:$PORT

'Django' 카테고리의 다른 글

Relationship between URLS and VIEWS  (0) 2020.10.29
Set Global Variable using settings.py  (0) 2020.10.29
Django URL with View  (0) 2020.10.29
Django Architecture  (0) 2020.10.29

관련글 더보기

댓글 영역