-
Notifications
You must be signed in to change notification settings - Fork 42
/
Dockerfile
55 lines (42 loc) · 1.66 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Use an official Python runtime as a parent image
FROM python:3.10-slim@sha256:8666a639a54acc810408e505e2c6b46b50834385701675ee177f578b3d2fdef9
# Environment variables
ARG YOUR_ENV
ENV YOUR_ENV=${YOUR_ENV:-development} \
PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1 \
PYTHONHASHSEED=random \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
POETRY_VIRTUALENVS_CREATE=false \
POETRY_NO_INTERACTION=1
# Install necessary build tools and dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
make \
build-essential \
libffi-dev \
libssl-dev \
python3-dev \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install Poetry in a known location and add to PATH
RUN curl -sSL https://install.python-poetry.org | python3 - \
&& ln -s /root/.local/bin/poetry /usr/local/bin/poetry
# Set the working directory in the container
WORKDIR /app
# Copy only pyproject.toml and poetry.lock to cache them in the Docker layer
COPY pyproject.toml poetry.lock /app/
# Install the dependencies from pyproject.toml using Poetry
RUN poetry install $(test "$YOUR_ENV" = production && echo "--only=main") --no-interaction --no-ansi
# Install the darwin-py package and CLI executable using pip
RUN pip install darwin-py
# The following steps are commented out to allow users to customize the Dockerfile:
# Copy the rest of the application code (uncomment and modify as needed)
# COPY . /app
# Expose any necessary ports (uncomment and modify as needed)
# EXPOSE 80
# Set an entry point or command (uncomment and modify as needed)
# CMD ["python", "/app/your_main_script.py"]
# End of Dockerfile