-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerfile
More file actions
35 lines (24 loc) · 813 Bytes
/
Copy pathContainerfile
File metadata and controls
35 lines (24 loc) · 813 Bytes
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
FROM docker.io/library/python:3.12-slim-trixie
WORKDIR /app
ENV PYTHONUNBUFFERED=1
ARG TARGETARCH
COPY requirements.txt .
RUN apt-get update && \
if [ "${TARGETARCH}" = "arm64" ]; then \
apt-get install -y --no-install-recommends build-essential; \
fi && \
python -m pip install --root-user-action=ignore -r requirements.txt && \
if [ "${TARGETARCH}" = "arm64" ]; then \
apt-get purge -y --auto-remove build-essential; \
fi && \
rm -rf /var/lib/apt/lists/*
COPY . .
# Generate encryption key
RUN fyers-auto-auth generate-key
# make the run.sh file executable
RUN chmod +x run.sh
# create an alias to run.sh
RUN ln -s /app/run.sh /usr/local/bin/ts
# set python executable path to container global python (used in run.sh)
ENV VENV_PYTHON=python
CMD ["ts", "start"]