chore(dev): update develop environment

This commit is contained in:
MingxuanGame
2025-07-26 15:03:56 +00:00
parent 9ceacd9771
commit ced315be9e
27 changed files with 3555 additions and 3414 deletions

View File

@@ -0,0 +1,56 @@
{
"name": "OSU Lazer API",
"dockerComposeFile": "docker-compose.yml",
"service": "devcontainer",
"shutdownAction": "stopCompose",
"workspaceFolder": "/workspaces/osu_lazer_api",
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"detachhead.basedpyright",
"charliermarsh.ruff",
"ms-python.debugpy",
"ms-vscode.vscode-json",
"redhat.vscode-yaml",
"ms-vscode.docker"
],
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"python.terminal.activateEnvironment": true,
"python.linting.enabled": true,
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": false,
"python.formatting.provider": "none",
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
}
},
"ruff.enable": true,
"ruff.lint.enable": true,
"ruff.format.enable": true,
"ruff.importStrategy": "fromEnvironment",
"files.exclude": {
"**/__pycache__": true,
"**/*.pyc": true
},
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false,
"python.testing.pytestArgs": [
"."
],
"terminal.integrated.defaultProfile.linux": "bash"
}
}
},
"features": {
"ghcr.io/va-h/devcontainers-features/uv:1": {}
},
"forwardPorts": [8000, 3306, 6379],
"postCreateCommand": "uv sync --dev && uv run pre-commit install",
"remoteUser": "vscode"
}

View File

@@ -0,0 +1,56 @@
version: '3.8'
services:
devcontainer:
image: mcr.microsoft.com/devcontainers/python:3.13
volumes:
- ../..:/workspaces:cached
- ~/.ssh:/home/vscode/.ssh:ro
command: sleep infinity
networks:
- devcontainer-network
depends_on:
- mysql
- redis
environment:
DATABASE_URL: mysql+aiomysql://osu_user:osu_password@mysql:3306/osu_api
REDIS_URL: redis://redis:6379/0
SECRET_KEY: dev-secret-key-change-in-production
OSU_CLIENT_ID: "5"
OSU_CLIENT_SECRET: "FGc9GAtyHzeQDshWP5Ah7dega8hJACAJpQtw6OXk"
mysql:
image: mysql:8.0
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: osu_api
MYSQL_USER: osu_user
MYSQL_PASSWORD: osu_password
ports:
- "3306:3306"
volumes:
- mysql-data:/var/lib/mysql
- ../mysql-init:/docker-entrypoint-initdb.d:cached
networks:
- devcontainer-network
command: --default-authentication-plugin=mysql_native_password
redis:
image: redis:7-alpine
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- redis-data:/data
networks:
- devcontainer-network
command: redis-server --appendonly yes
networks:
devcontainer-network:
driver: bridge
volumes:
mysql-data:
redis-data: