The run.sh script provides convenient commands for common operations:
./run.sh build # Build the Docker image
./run.sh up # Start container in background
./run.sh down # Stop container
./run.sh logs # View container logs./run.sh jupyter # Start Jupyter Lab (recommended)
./run.sh python # Start Python REPL
./run.sh bash # Start bash shell
./run.sh claude # Start Claude Code CLI./run.sh run script.py # Run a Python script from code/ directory
./run.sh install pandas # Install additional packagesdocker-setup/
├── data/ # Your datasets go here
├── notebooks/ # Jupyter notebooks
├── code/ # Python scripts
├── Dockerfile # Container configuration
└── run.sh # Helper script
Put your datasets in the data/ directory. They'll be available at /workspace/data/ inside the container.
import pandas as pd
# Load a dataset
df = pd.read_csv('/workspace/data/your_dataset.csv')
# For large files, use chunks
for chunk in pd.read_csv('/workspace/data/large_file.csv', chunksize=10000):
process(chunk)- Jupyter notebooks are automatically saved to
notebooks/ - Python scripts go in
code/ - Processed data can be saved to
data/
# Check memory usage
import psutil
print(f"Memory: {psutil.virtual_memory().percent}%")
# Optimize data types
df['id'] = df['id'].astype('int32')
df['category'] = df['category'].astype('category')
# Clear variables
del large_dataframe
import gc; gc.collect()# Use chunking for large files
def process_large_file(filename):
for chunk in pd.read_csv(filename, chunksize=10000):
# Process each chunk
result = chunk.groupby('column').sum()
# Save or accumulate results
yield result
# Use efficient file formats
df.to_parquet('data.parquet') # Faster than CSV
df.to_feather('data.feather') # Very fast for temporary storage- Load data:
./run.sh jupyter - Explore in Jupyter notebook
- Create processing script in
code/ - Run script:
./run.sh run process_data.py - Visualize results back in Jupyter
- Data preprocessing in Jupyter
- Model training script in
code/ - Evaluation and visualization in Jupyter
- Save models to
data/models/
import spacy
# Load pre-installed model
nlp = spacy.load("en_core_web_sm")
# Process text
doc = nlp("Your text here")
for token in doc:
print(token.text, token.pos_, token.lemma_)Install extensions inside the container:
./run.sh bash
pip install jupyterlab-git
jupyter labextension install @jupyterlab/gitTo permanently add packages, edit the Dockerfile and rebuild:
RUN pip install --no-cache-dir \
your-new-packageSet environment variables in docker-compose.yml:
environment:
- CUSTOM_VAR=valueCreate a startup script in code/startup.py and run it automatically by modifying the Dockerfile CMD.