Skip to content

Commit b4a9100

Browse files
performance testing
1 parent 956b518 commit b4a9100

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

Dockerfile

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
11
# ─────────────────────────────
2-
#Use Slim Python Base
2+
#Base Image: Slim & Fast
33
# ─────────────────────────────
44
FROM python:3.12-slim-bookworm
55

66
# ─────────────────────────────
7-
# 🧼 Set Environment Vars
8-
# ─────────────────────────────
9-
ARG BUILD_MODE=remote
10-
ENV BUILD_MODE=${BUILD_MODE}
11-
ENV PORT=8501
12-
13-
# ─────────────────────────────
14-
# 🛠 Install Required OS Packages (only essentials)
7+
# 📦 Install OS Dependencies
158
# ─────────────────────────────
169
RUN apt-get update && apt-get install -y --no-install-recommends \
1710
git \
1811
gcc \
19-
libpq-dev \
2012
curl \
13+
libpq-dev \
2114
&& apt-get clean \
2215
&& rm -rf /var/lib/apt/lists/*
2316

2417
# ─────────────────────────────
25-
# 📦 Install Python Packages
18+
# 🔁 Set Build Mode Variable
2619
# ─────────────────────────────
27-
# Always set working dir to avoid weird pip behavior
28-
WORKDIR /app
20+
ARG BUILD_MODE=remote
21+
ENV BUILD_MODE=${BUILD_MODE}
2922

30-
# Copy early if needed for layer caching
31-
COPY requirements.txt requirements.txt
32-
RUN pip install --no-cache-dir -r requirements.txt
23+
# ─────────────────────────────
24+
# ⏳ Work in Temporary Directory
25+
# ─────────────────────────────
26+
WORKDIR /tmp/build-context
3327

3428
# ─────────────────────────────
35-
# 📁 Clone or Copy Code
29+
# 🧱 Clone or Copy App Code
3630
# ─────────────────────────────
37-
# Remote clone
3831
RUN if [ "$BUILD_MODE" = "remote" ]; then \
39-
git clone https://github.com/curiouslearning/cl-dashboard-internal.git /app ; \
32+
git clone https://github.com/curiouslearning/cl-dashboard-internal.git /cl-dashboard-internal ; \
4033
fi
4134

42-
# Local copy
4335
COPY . /tmp/local-copy
4436
RUN if [ "$BUILD_MODE" = "local" ]; then \
45-
cp -r /tmp/local-copy/* /app ; \
37+
cp -r /tmp/local-copy /cl-dashboard-internal ; \
4638
fi
4739

4840
# ─────────────────────────────
49-
# ▶ Entrypoint
41+
# 📦 Install Python Requirements
5042
# ─────────────────────────────
43+
WORKDIR /cl-dashboard-internal
44+
COPY requirements.txt requirements.txt # In case not already copied
45+
RUN pip install --no-cache-dir -r requirements.txt
46+
47+
# ─────────────────────────────
48+
# 🎯 Set Entrypoint for Cloud Run
49+
# ─────────────────────────────
50+
ENV PORT=8501
5151
COPY entrypoint.sh /entrypoint.sh
5252
RUN chmod +x /entrypoint.sh
5353

0 commit comments

Comments
 (0)