Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Rat Aint Tieba
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bing Chilling
Rat Aint Tieba
Commits
0e7020bd
Commit
0e7020bd
authored
1 year ago
by
John Xina
Browse files
Options
Downloads
Patches
Plain Diff
add Dockerfile
parent
59897a3c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Dockerfile
+40
-0
40 additions, 0 deletions
Dockerfile
with
40 additions
and
0 deletions
Dockerfile
0 → 100644
+
40
−
0
View file @
0e7020bd
# Use the official Python image as the base image
FROM
python:3.11-slim
# Install the patch utility
RUN
apt-get update
&&
apt-get
install
-y
patch
# Set the working directory to /app
WORKDIR
/app
# Copy the local requirements.txt file to the container
COPY
requirements.txt .
# Install the Python dependencies
RUN
pip
install
-r
requirements.txt
# Copy the aiotieba-handle-exception-expose.patch file to the container
COPY
aiotieba-handle-exception-expose.patch .
# Replace paths in the patch file to reflect the correct paths within the container
RUN
sed
-i
's|venv/lib/python3.11/site-packages/|/usr/local/lib/python3.11/site-packages/|g'
aiotieba-handle-exception-expose.patch
# Apply the patch using the 'patch' command
RUN
patch
-d
/
-p0
< aiotieba-handle-exception-expose.patch
# Expose port 8886
EXPOSE
8886
# Copy the local code to the container
COPY
. .
# Run the Python script with Uvicorn, binding to all available network interfaces
CMD
["gunicorn", "app:proxified", "--max-requests", "50", "--worker-class", "uvicorn.workers.UvicornWorker", "-b", "0.0.0.0:8886"]
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment