-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
57 lines (45 loc) · 1.38 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
56
57
# To run a build that works on AWS us the following command:
#docker build --platform linux/amd64 -t streptocad .
# Use Python 3.11 as the base image
FROM python:3.11-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
gcc \
libc6-dev \
libffi-dev \
libssl-dev \
zlib1g-dev \
libbz2-dev \
libncurses5-dev \
libncursesw5-dev \
libreadline-dev \
libsqlite3-dev \
libgdbm-dev \
libdb5.3-dev \
liblzma-dev \
libexpat1-dev \
&& rm -rf /var/lib/apt/lists/*
# Set the working directory in the container
WORKDIR /web_app
# Copy the requirements file into the container
COPY requirements.txt .
# Upgrade pip, setuptools, and wheel
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
# Install the required packages, excluding the -e . line
RUN grep -v '^-e' requirements.txt > requirements_filtered.txt && \
pip install --no-cache-dir -r requirements_filtered.txt
# Copy the rest of the application code into the container
COPY . .
# Install the current project
RUN pip install -e .
# Expose the port that Dash runs on (default is 8050)
EXPOSE 8050
# Set environment variables
ENV FLASK_ENV=production
ENV DOCKER_CONTAINER=true
# Command to run the application
CMD ["python", "web_app/application.py"]