-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (30 loc) · 1.14 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
# Stage 1: Build environment
FROM python:3.10-slim-buster AS builder
# Set the working directory
WORKDIR /home/app
# Update the package index and install system-level dependencies
RUN apt-get update && \
apt-get install -y build-essential \
--no-install-recommends \
ffmpeg cmake libsm6 libxext6 libxrender-dev && \
apt-get -y autoremove && \
apt-get clean autoclean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Copy the contents of the root directory into the container at /home/app
COPY . .
# Install Python Dependencies
RUN pip install --no-cache-dir --upgrade pip \
--trusted-host pypi.python.org \
--no-deps -r requirements.txt && \
rm -rf /root/.cache/pip/*
# Stage 2: Runtime environment
FROM python:3.10-slim-buster AS final
# Expose the port that the application will run on (optional)
EXPOSE 8050
# Copy the necessary from the builder stage
COPY --from=builder /home/app /home/app
COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
# Change the working directory
WORKDIR /home/app/functions
# Start the application
CMD [ "python3", "dashboard_f22.py" ]