-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
25 lines (19 loc) · 692 Bytes
/
Copy pathDockerfile
File metadata and controls
25 lines (19 loc) · 692 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
FROM python:3.9-slim
# Creating a directory for the application
WORKDIR /app
# Copying requirements.txt first for better layer caching
COPY requirements.txt /app/
# Installing required packages from requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Copying the script to the container
COPY xml_to_csv.py /app/
# Creating entrypoint script that preserves the original behavior
RUN echo '#!/bin/bash\n\
input_file=$1\n\
input_dir=$(dirname "$input_file")\n\
filename=$(basename "$input_file")\n\
cd "$input_dir"\n\
python /app/xml_to_csv.py "$filename"\n' > /app/entrypoint.sh && \
chmod +x /app/entrypoint.sh
# Setting the entrypoint
ENTRYPOINT ["/app/entrypoint.sh"]