Commit dc8ad10d authored by Benavides Ontiveros's avatar Benavides Ontiveros
Browse files

add Docker file

parent a8cfb1d6
# Use a lightweight Python base image
FROM python:3.10-slim
# Set working directory inside container
WORKDIR /app
# Copy dependency file first (for caching)
COPY requirements.txt .
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of your application code
COPY . .
# Set environment variables (you can override these when running the container)
ENV REDDIT_CLIENT_ID= \
REDDIT_CLIENT_SECRET= \
PORT=8000
# Expose the port your app runs on
EXPOSE ${PORT}
# Command to run your Python app (update as needed)
# For example, if you have an app.py file:
CMD ["python", "app.py"]
...@@ -50,5 +50,8 @@ json_output = json.dumps(data, indent=4) ...@@ -50,5 +50,8 @@ json_output = json.dumps(data, indent=4)
print(json_output) print(json_output)
# Optionally, save to file: # Optionally, save to file:
with open("reddit_data.json", "w") as f: # with open("reddit_data.json", "w") as f:
# json.dump(data, f, indent=4)
with open("/app/output/reddit_data.json", "w") as f:
json.dump(data, f, indent=4) json.dump(data, f, indent=4)
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment