-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.market_data
45 lines (34 loc) · 1.11 KB
/
Dockerfile.market_data
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
# Use the alpine variant of Python for an even smaller footprint
ARG PYTHON_VERSION=3.11.9
FROM python:${PYTHON_VERSION}-alpine
# Prevents Python from writing pyc files
# ENV PYTHONDONTWRITEBYTECODE=1
# Keeps Python from buffering stdout and stderr
ENV PYTHONUNBUFFERED=1
# Set the working directory inside the container
WORKDIR /carmagnole
RUN apk add --no-cache \
chromium \
chromium-chromedriver \
unzip \
bash \
udev \
ttf-freefont\
ca-certificates \
curl \
openssl \
postgresql-client \
cronie \
&& update-ca-certificates
COPY ./market_data/ /carmagnole/market_data/
COPY ./utils/models.py /carmagnole/market_data/utils/models.py
COPY ./market_data/requirements.txt .
ENV CHROME_BIN=/usr/bin/chromium-browser \
CHROMEDRIVER=/usr/bin/chromedriver
RUN --mount=type=cache,target=/root/.cache/pip \
pip install --upgrade pip && \
pip install -r requirements.txt
# Ensure the fetch_market_data.py script is executable
RUN chmod +x /carmagnole/market_data/fetch_market_data.py
# Command to run the script
CMD ["python", "/carmagnole/market_data/fetch_market_data.py"]