lqg 2 years ago
parent
commit
b0ca091ea6
8 changed files with 126 additions and 0 deletions
  1. 27 0
      .dockerignore
  2. 0 0
      .github/workflows/build.yml
  3. 19 0
      .vscode/launch.json
  4. 26 0
      .vscode/tasks.json
  5. 23 0
      Dockerfile
  6. 12 0
      README.md
  7. 11 0
      docker-compose.debug.yml
  8. 8 0
      docker-compose.yml

+ 27 - 0
.dockerignore

@@ -0,0 +1,27 @@
+**/__pycache__
+**/.venv
+**/.classpath
+**/.dockerignore
+**/.env
+**/.git
+**/.gitignore
+**/.project
+**/.settings
+**/.toolstarget
+**/.vs
+**/.vscode
+**/*.*proj.user
+**/*.dbmdl
+**/*.jfm
+**/bin
+**/charts
+**/docker-compose*
+**/compose*
+**/Dockerfile*
+**/node_modules
+**/npm-debug.log
+**/obj
+**/secrets.dev.yaml
+**/values.dev.yaml
+LICENSE
+README.md

+ 0 - 0
.github/workflows/build.yml


+ 19 - 0
.vscode/launch.json

@@ -0,0 +1,19 @@
+{
+    "configurations": [
+        {
+            "name": "Docker: Python - General",
+            "type": "docker",
+            "request": "launch",
+            "preLaunchTask": "docker-run: debug",
+            "python": {
+                "pathMappings": [
+                    {
+                        "localRoot": "${workspaceFolder}",
+                        "remoteRoot": "/app"
+                    }
+                ],
+                "projectType": "general"
+            }
+        }
+    ]
+}

+ 26 - 0
.vscode/tasks.json

@@ -0,0 +1,26 @@
+{
+	"version": "2.0.0",
+	"tasks": [
+		{
+			"type": "docker-build",
+			"label": "docker-build",
+			"platform": "python",
+			"dockerBuild": {
+				"tag": "searchdomain:latest",
+				"dockerfile": "${workspaceFolder}/Dockerfile",
+				"context": "${workspaceFolder}",
+				"pull": true
+			}
+		},
+		{
+			"type": "docker-run",
+			"label": "docker-run: debug",
+			"dependsOn": [
+				"docker-build"
+			],
+			"python": {
+				"file": "main.py"
+			}
+		}
+	]
+}

+ 23 - 0
Dockerfile

@@ -0,0 +1,23 @@
+# For more information, please refer to https://aka.ms/vscode-docker-python
+FROM python:3.8-slim
+
+# Keeps Python from generating .pyc files in the container
+ENV PYTHONDONTWRITEBYTECODE=1
+
+# Turns off buffering for easier container logging
+ENV PYTHONUNBUFFERED=1
+
+# Install pip requirements
+COPY requirements.txt .
+RUN python -m pip install -r requirements.txt
+
+WORKDIR /app
+COPY . /app
+
+# Creates a non-root user with an explicit UID and adds permission to access the /app folder
+# For more info, please refer to https://aka.ms/vscode-docker-python-configure-containers
+RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app
+USER appuser
+
+# During debugging, this entry point will be overridden. For more information, please refer to https://aka.ms/vscode-docker-python-debug
+CMD ["python", "main.py"]

+ 12 - 0
README.md

@@ -2,8 +2,20 @@
 
 域名批量检索可用
 
+## Develop
+
+
 ```
 virtualvenv .venv
 pip install -r requirements.txt
+```
+
+1、批量生成域名
+```
+python generateDomain.py
+```
+
+2、批量检测域名是否可以注册,并将结果保存到数据库或文件
+```
 python main.py
 ```

+ 11 - 0
docker-compose.debug.yml

@@ -0,0 +1,11 @@
+version: '3.4'
+
+services:
+  searchdomain:
+    image: searchdomain
+    build:
+      context: .
+      dockerfile: ./Dockerfile
+    command: ["sh", "-c", "pip install debugpy -t /tmp && python /tmp/debugpy --wait-for-client --listen 0.0.0.0:5678 main.py "]
+    ports:
+      - 5678:5678

+ 8 - 0
docker-compose.yml

@@ -0,0 +1,8 @@
+version: '3.4'
+
+services:
+  searchdomain:
+    image: searchdomain
+    build:
+      context: .
+      dockerfile: ./Dockerfile