Skip to content

Instantly share code, notes, and snippets.

@tg12
Created January 17, 2024 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tg12/33096b99cc9baad3a8d0643e35f7fc95 to your computer and use it in GitHub Desktop.
Save tg12/33096b99cc9baad3a8d0643e35f7fc95 to your computer and use it in GitHub Desktop.
Dockerfile Template
# Use Python 3.12 slim image
FROM python:3.12.1-slim
# Set Environment Variables
ENV PYTHONUNBUFFERED=1 \
TZ=Europe/London
ENV PYTHONOPTIMIZE=TRUE
ENV PYTHONMALLOC=malloc
# Set the working directory
WORKDIR /usr/src/app
# Copy all files in the local directory to the container
COPY . .
# Update pip, then install pipreqs and project requirements
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir pipreqs && \
pipreqs --force --mode=gt . && \
pip install --no-cache-dir -r requirements.txt
# Use CMD to run both Python scripts in sequence
CMD sh -c "python ./get_backtest_data.py && python ./mean_skew.py"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment