Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
software-project-WS25
Reddit Team
Commits
dc8ad10d
Commit
dc8ad10d
authored
Nov 04, 2025
by
Benavides Ontiveros
Browse files
add Docker file
parent
a8cfb1d6
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Dockerfile
0 → 100644
View file @
dc8ad10d
# 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"]
app.py
View file @
dc8ad10d
...
@@ -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
)
reddit_data.json
View file @
dc8ad10d
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment