Ajuste Dockerfile
This commit is contained in:
parent
a41e383dad
commit
f8b97d2907
5 changed files with 162 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"state" : "go",
|
"state" : "go",
|
||||||
"url": "/api/v1",
|
"url": "",
|
||||||
"log": {
|
"log": {
|
||||||
"request": {
|
"request": {
|
||||||
"name": "request.json",
|
"name": "request.json",
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
{
|
{
|
||||||
"host": "localhost",
|
"host": "localhost",
|
||||||
"port": 5432,
|
"port": 5432,
|
||||||
"name": "mirror",
|
"name": "postgres",
|
||||||
"user": "postgres",
|
"user": "postgres",
|
||||||
"password": "root",
|
"password": "mirrorapidb",
|
||||||
"charset": "UTF8",
|
"charset": "UTF8",
|
||||||
"pool": {
|
"pool": {
|
||||||
"pre_ping": true,
|
"pre_ping": true,
|
||||||
|
|
|
||||||
148
mirrorApi.code-workspace
Normal file
148
mirrorApi.code-workspace
Normal file
|
|
@ -0,0 +1,148 @@
|
||||||
|
{
|
||||||
|
"folders": [
|
||||||
|
{ "path": "D:/Projetos/MirrorAPI" }
|
||||||
|
],
|
||||||
|
"settings": {
|
||||||
|
// === GERAL ===
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"editor.codeActionsOnSave": {
|
||||||
|
"source.fixAll": "explicit",
|
||||||
|
"source.organizeImports": "explicit"
|
||||||
|
},
|
||||||
|
"editor.formatOnPaste": false,
|
||||||
|
"editor.formatOnType": false,
|
||||||
|
"editor.minimap.enabled": false,
|
||||||
|
"files.trimTrailingWhitespace": true,
|
||||||
|
"files.autoSave": "onFocusChange",
|
||||||
|
"telemetry.telemetryLevel": "off",
|
||||||
|
"update.mode": "manual",
|
||||||
|
|
||||||
|
// === PERFORMANCE ===
|
||||||
|
"files.watcherExclude": {
|
||||||
|
"**/__pycache__/**": true,
|
||||||
|
"**/.mypy_cache/**": true,
|
||||||
|
|
||||||
|
"**/.pytest_cache/**": true,
|
||||||
|
"**/.venv/**": true,
|
||||||
|
"**/venv/**": true,
|
||||||
|
"**/.git/**": true
|
||||||
|
},
|
||||||
|
"search.exclude": {
|
||||||
|
"**/__pycache__": true,
|
||||||
|
"**/.git": true,
|
||||||
|
"**/.mypy_cache": true,
|
||||||
|
"**/.pytest_cache": true
|
||||||
|
},
|
||||||
|
|
||||||
|
// === PYTHON ===
|
||||||
|
"python.defaultInterpreterPath": "D:/Projetos/MirrorAPI/venv/Scripts/python.exe",
|
||||||
|
"python.analysis.typeCheckingMode": "off",
|
||||||
|
"python.analysis.useLibraryCodeForTypes": true,
|
||||||
|
"python.languageServer": "Pylance",
|
||||||
|
"python.formatting.provider": "black",
|
||||||
|
"python.formatting.blackArgs": ["--line-length", "100"],
|
||||||
|
"python.linting.enabled": true,
|
||||||
|
"python.linting.pylintEnabled": false,
|
||||||
|
"python.linting.flake8Enabled": true,
|
||||||
|
"python.linting.flake8Args": ["--max-line-length=100"],
|
||||||
|
"[python]": {
|
||||||
|
"editor.defaultFormatter": "ms-python.black-formatter",
|
||||||
|
"editor.formatOnSave": true
|
||||||
|
},
|
||||||
|
|
||||||
|
// === TERMINAIS INTEGRADOS ===
|
||||||
|
"terminal.integrated.profiles.windows": {
|
||||||
|
"FastAPI Dev": {
|
||||||
|
"path": "cmd.exe",
|
||||||
|
"args": [
|
||||||
|
"/k",
|
||||||
|
"cd D:\\Projetos\\MirrorAPI && venv\\Scripts\\activate && uvicorn main:app --reload --log-level debug"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"FastAPI Prod": {
|
||||||
|
"path": "cmd.exe",
|
||||||
|
"args": [
|
||||||
|
"/k",
|
||||||
|
"cd D:\\Projetos\\MirrorAPI && venv\\Scripts\\activate && uvicorn main:app --host 0.0.0.0 --port 8000"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"Python Shell": {
|
||||||
|
"path": "cmd.exe",
|
||||||
|
"args": ["/k", "cd D:\\Projetos\\MirrorAPI && venv\\Scripts\\activate"]
|
||||||
|
},
|
||||||
|
"Git Bash": {
|
||||||
|
"path": "C:\\Program Files\\Git\\bin\\bash.exe"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"terminal.integrated.defaultProfile.windows": "Git Bash",
|
||||||
|
|
||||||
|
// === GIT ===
|
||||||
|
"git.enabled": true,
|
||||||
|
"git.autorefresh": false,
|
||||||
|
"git.fetchOnPull": true,
|
||||||
|
"git.confirmSync": false,
|
||||||
|
|
||||||
|
// === VISUAL ===
|
||||||
|
"workbench.colorTheme": "Default Dark Modern",
|
||||||
|
"window.zoomLevel": 0,
|
||||||
|
"breadcrumbs.enabled": true,
|
||||||
|
"explorer.compactFolders": false,
|
||||||
|
|
||||||
|
// === TESTES ===
|
||||||
|
"python.testing.pytestEnabled": true,
|
||||||
|
"python.testing.unittestEnabled": false,
|
||||||
|
"python.testing.autoTestDiscoverOnSaveEnabled": true,
|
||||||
|
|
||||||
|
// === MISC ===
|
||||||
|
"files.exclude": {
|
||||||
|
"**/.DS_Store": true,
|
||||||
|
"**/*.log": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"launch": {
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Debug FastAPI",
|
||||||
|
"type": "python",
|
||||||
|
"request": "launch",
|
||||||
|
"module": "uvicorn",
|
||||||
|
"args": [
|
||||||
|
"main:app",
|
||||||
|
"--reload",
|
||||||
|
"--host",
|
||||||
|
"127.0.0.1",
|
||||||
|
"--port",
|
||||||
|
"8000"
|
||||||
|
],
|
||||||
|
"jinja": true,
|
||||||
|
"justMyCode": true,
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"env": {
|
||||||
|
"PYTHONPATH": "${workspaceFolder}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Pytest All",
|
||||||
|
"type": "python",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${workspaceFolder}/venv/Scripts/pytest.exe",
|
||||||
|
"args": ["-v"],
|
||||||
|
"console": "integratedTerminal"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"extensions": {
|
||||||
|
"recommendations": [
|
||||||
|
// === PYTHON ===
|
||||||
|
"ms-python.python",
|
||||||
|
"ms-python.black-formatter",
|
||||||
|
"ms-python.flake8",
|
||||||
|
"ms-python.pylance",
|
||||||
|
"littlefoxteam.vscode-python-test-adapter",
|
||||||
|
|
||||||
|
// === GIT ===
|
||||||
|
"eamodio.gitlens"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -32,3 +32,4 @@ starlette==0.47.2
|
||||||
typing-inspection==0.4.1
|
typing-inspection==0.4.1
|
||||||
typing_extensions==4.14.1
|
typing_extensions==4.14.1
|
||||||
uvicorn==0.35.0
|
uvicorn==0.35.0
|
||||||
|
psycopg2-binary>=2.9.9
|
||||||
|
|
|
||||||
10
teste.py
Normal file
10
teste.py
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
import psycopg2
|
||||||
|
|
||||||
|
conn = psycopg2.connect(
|
||||||
|
dbname="mirror",
|
||||||
|
user="postgres",
|
||||||
|
password="mirrorapidb",
|
||||||
|
host="127.0.0.1", # localhost
|
||||||
|
port=5432,
|
||||||
|
options="-c client_encoding=LATIN1", # troque LATIN1 por UTF8 se o banco for UTF8
|
||||||
|
)
|
||||||
Loading…
Add table
Reference in a new issue