Skip to content

Commit

Permalink
Try Dockerfile based on requirements_simple.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
jbreffle committed Feb 18, 2024
1 parent 0ae4a9d commit 8ca6b38
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
build:
runs-on: ubuntu-latest
container:
image: jbreffle/monkeytype-analysis:latest # Use the Docker image from Docker Hub
image: jbreffle/monkeytype-analysis:slim # Use the Docker image from Docker Hub

steps:
- uses: actions/checkout@v4
Expand Down
11 changes: 3 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
FROM python:3.10

# Install dependencies in a single layer and clean up in the same RUN to reduce image size
RUN python -m pip install --upgrade pip && \
pip install flake8 pytest && \
rm -rf /var/lib/apt/lists/*
FROM python:3.10-slim

# Set the working directory to /app
WORKDIR /app

# First, copy only requirements.txt and install Python dependencies to leverage Docker cache
COPY requirements.txt .
RUN if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
COPY requirements_simple.txt requirements.txt
RUN if [ -f requirements.txt ]; then pip install --no-cache-dir -r requirements.txt; fi

# Then copy the rest of the application
COPY . .
22 changes: 22 additions & 0 deletions requirements_simple.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#jupyter # to run notebooks
#torch
#hyperopt
#pytest
#mpld3
#statsmodels
pandas
numpy
matplotlib
#scikit-learn # import sklearn
scipy
pyprojroot
PyYAML # import yaml
streamlit
# pyarrow # import pyarrow.parquet as pq
boto3 # For AWS services, like S3 and EC2
python-dotenv # from dotenv import load_dotenv; load_dotenv()
awswrangler # import awswrangler as wr
s3fs # Necessary for pandas to read/write from/to S3
# For GitHub actions
flake8
pytest
2 changes: 0 additions & 2 deletions streamlit/pages/1_Trial_difficulty.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import streamlit as st
import matplotlib.pyplot as plt
import numpy as np
from scipy.optimize import curve_fit
import pyprojroot

from src import plot
Expand Down

0 comments on commit 8ca6b38

Please sign in to comment.