This repository has been archived by the owner on Oct 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1ded541
commit 6630f44
Showing
6 changed files
with
181 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
.git | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build | ||
develop-eggs | ||
dist | ||
downloads | ||
eggs | ||
.eggs | ||
lib | ||
lib64 | ||
parts | ||
sdist | ||
var | ||
wheels | ||
pip-wheel-metadata | ||
share/python-wheels | ||
*.egg-info | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
|
||
# Flask stuff: | ||
instance | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build | ||
|
||
# PyBuilder | ||
target | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default | ||
ipython_config.py | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# celery beat schedule file | ||
celerybeat-schedule | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env | ||
venv | ||
ENV | ||
env.bak | ||
venv.bak | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mypy | ||
.mypy_cache | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM python:3.8.1 | ||
|
||
RUN mkdir /api | ||
WORKDIR /api | ||
|
||
COPY ./requirements.txt /api/requirements.txt | ||
|
||
RUN pip install -r requirements.txt | ||
|
||
COPY . /api | ||
|
||
CMD uvicorn baiduspider.api.app:app --host=0.0.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: baiduspider-deploy | ||
labels: | ||
app: baiduspider-app | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: baiduspider-app | ||
replicas: 2 | ||
strategy: | ||
type: RollingUpdate | ||
rollingUpdate: | ||
maxSurge: 1 | ||
maxUnavailable: 0 | ||
template: | ||
metadata: | ||
labels: | ||
app: baiduspider-app | ||
spec: | ||
containers: | ||
- name: baiduspider-app | ||
image: samzhangjy/baiduspider:1.0.0 | ||
imagePullPolicy: Always | ||
ports: | ||
- containerPort: 8000 | ||
resources: | ||
requests: | ||
memory: "64Mi" | ||
cpu: "50m" | ||
limits: | ||
memory: "256Mi" | ||
cpu: "500m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: "3.4" | ||
services: | ||
python: | ||
build: | ||
context: . | ||
container_name: api | ||
image: samzhangjy/baiduspider:1.0.0 | ||
ports: | ||
- 8000:8000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: baiduspider | ||
image: okteto/python:3 | ||
command: | ||
- bash | ||
workdir: /okteto | ||
forward: | ||
- 8080:8080 | ||
reverse: | ||
- 9000:9000 | ||
volumes: | ||
- /root/.cache/pip | ||
persistentVolume: | ||
enabled: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: baiduspider-service | ||
spec: | ||
type: LoadBalancer | ||
selector: | ||
app: baiduspider-app | ||
ports: | ||
- protocol: TCP | ||
port: 80 | ||
targetPort: 8000 |
6630f44
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: