-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (36 loc) · 1.07 KB
/
Copy pathDockerfile
File metadata and controls
47 lines (36 loc) · 1.07 KB
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
# Use the official Python image with a specific version
FROM python:3.12-slim-bookworm
# Define an argument to control whether to run pipenv lock
ARG RUN_PIPENV_LOCK=false
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# for compiling biotite
# Install necessary packages for building wheels
RUN apt-get update && apt-get install -y \
build-essential \
python3-dev \
libssl-dev \
libffi-dev \
libxml2-dev \
libxslt1-dev \
zlib1g-dev \
wget \
git
# Install Cython if needed for biotite
RUN pip install --upgrade pip setuptools wheel cython
RUN pip install pipenv
# Create a working directory
WORKDIR /app
# Install dependencies
COPY Pipfile* ./
# Conditionally run pipenv lock based on the argument
RUN if [ "$RUN_PIPENV_LOCK" = "true" ]; then pipenv lock --dev --clear; fi
# Install all dependencies using the wheels
RUN pipenv sync --dev --system
# Copy the app code
COPY ./app /app
# Expose the port
EXPOSE 8000
# Command to run the application
# CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]