screenshot-to-code/backend/Dockerfile
2023-11-16 13:08:18 -05:00

35 lines
938 B
Docker

FROM python:3.12-slim-bullseye
#ARG YOUR_ENV # Set your environment variable (prod vs. dev)
# Set environment variables
ENV PYTHONFAULTHANDLER 1
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PYTHONHASHSEED random
ENV PIP_NO_CACHE_DIR off
ENV PIP_DISABLE_PIP_VERSION_CHECK on
ENV PIP_DEFAULT_TIMEOUT 100
ENV POETRY_VERSION 1.4.1
#ENV ENVIRONMENT $YOUR_ENV
# Install system dependencies
RUN pip install "poetry==$POETRY_VERSION"
# Set work directory
WORKDIR /app
# Copy only requirements to cache them in docker layer
COPY poetry.lock pyproject.toml /app/
# Disable the creation of virtual environments
RUN poetry config virtualenvs.create false
# Install dependencies
RUN poetry install
# if you have dev dependencies and runnning in production
#poetry install $(test "$YOUR_ENV" == production && echo "--no-dev") --no-interaction --no-ansi
# Copy the current directory contents into the container at /app
COPY ./ /app/