Skip to content

Commit 956b518

Browse files
performance testing
1 parent 07d7b88 commit 956b518

File tree

1 file changed

+36
-22
lines changed

1 file changed

+36
-22
lines changed

Dockerfile

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,53 @@
1-
# Set the build mode (default to remote)
1+
# ─────────────────────────────
2+
# ⚡ Use Slim Python Base
3+
# ─────────────────────────────
4+
FROM python:3.12-slim-bookworm
5+
6+
# ─────────────────────────────
7+
# 🧼 Set Environment Vars
8+
# ─────────────────────────────
29
ARG BUILD_MODE=remote
3-
FROM python:3.12.3-bookworm
4-
5-
ARG BUILD_MODE
610
ENV BUILD_MODE=${BUILD_MODE}
11+
ENV PORT=8501
712

8-
# Install required tools
9-
RUN apt-get update && apt-get install -y \
10-
build-essential \
11-
curl \
13+
# ─────────────────────────────
14+
# 🛠 Install Required OS Packages (only essentials)
15+
# ─────────────────────────────
16+
RUN apt-get update && apt-get install -y --no-install-recommends \
1217
git \
13-
python3-pip \
14-
software-properties-common \
18+
gcc \
19+
libpq-dev \
20+
curl \
21+
&& apt-get clean \
1522
&& rm -rf /var/lib/apt/lists/*
1623

17-
# Set the workdir to a neutral temp folder first
18-
WORKDIR /tmp/build-context
24+
# ─────────────────────────────
25+
# 📦 Install Python Packages
26+
# ─────────────────────────────
27+
# Always set working dir to avoid weird pip behavior
28+
WORKDIR /app
29+
30+
# Copy early if needed for layer caching
31+
COPY requirements.txt requirements.txt
32+
RUN pip install --no-cache-dir -r requirements.txt
1933

20-
# Clone OR copy conditionally
34+
# ─────────────────────────────
35+
# 📁 Clone or Copy Code
36+
# ─────────────────────────────
37+
# Remote clone
2138
RUN if [ "$BUILD_MODE" = "remote" ]; then \
22-
git clone https://github.com/curiouslearning/cl-dashboard-internal.git /cl-dashboard-internal ; \
39+
git clone https://github.com/curiouslearning/cl-dashboard-internal.git /app ; \
2340
fi
2441

25-
# Copy only if local
42+
# Local copy
2643
COPY . /tmp/local-copy
2744
RUN if [ "$BUILD_MODE" = "local" ]; then \
28-
cp -r /tmp/local-copy /cl-dashboard-internal ; \
45+
cp -r /tmp/local-copy/* /app ; \
2946
fi
3047

31-
WORKDIR /cl-dashboard-internal
32-
33-
RUN pip3 install --no-cache-dir -r requirements.txt
34-
35-
ENV PORT=8501
36-
48+
# ─────────────────────────────
49+
# ▶ Entrypoint
50+
# ─────────────────────────────
3751
COPY entrypoint.sh /entrypoint.sh
3852
RUN chmod +x /entrypoint.sh
3953

0 commit comments

Comments
 (0)