-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile.data
More file actions
27 lines (19 loc) · 752 Bytes
/
Dockerfile.data
File metadata and controls
27 lines (19 loc) · 752 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
# Use a minimal base image with Python 3.11
FROM python:3.11-slim
# Set the working directory inside the container
WORKDIR /app
# Copy requirements file and install dependencies
COPY requirements.txt .
COPY .env .
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application files
COPY . .
# The folder where the downloaded data will be persisted
VOLUME ["/app/output"]
# Remove data files during build
RUN rm -f data/day??_input.txt
RUN rm -f /app/output/data/day??_input.txt
# Run the download script to download the data
CMD ["bash", "-c", "python download_data.py && mkdir -p /app/output/data && cp ./data/day??_input.txt /app/output/data/"]
# Automatically exit the container after execution