From 5f05037f5f37c4bf55674eb6a168d00203f9d89b Mon Sep 17 00:00:00 2001 From: sm4640 Date: Sat, 12 Apr 2025 14:40:09 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Settings:=20[#24]=20dockerfile?= =?UTF-8?q?=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3849e0e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +# Use an official Python runtime as a parent image +FROM python:3.12-slim-bullseye + +# Set environment variables +ENV PYTHONUNBUFFERED 1 +ENV PYTHONDONTWRITEBYTECODE 1 + +# Set the working directory +WORKDIR /app + +# Install Python dependencies +COPY requirements.txt /app/ + +# 시스템 패키지 설치 +RUN apt-get update && apt-get install -y \ + build-essential \ + libpq-dev \ + pkg-config \ + && rm -rf /var/lib/apt/lists/* + +# 첫 번째 시도 +RUN pip install --upgrade pip || \ + # 실패할 경우, python.exe -m pip로 재시도 + python.exe -m pip install --upgrade pip +RUN pip install --no-cache-dir -r requirements.txt + +# Copy the Django project +COPY . /app/ \ No newline at end of file