diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..5058260 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,41 @@ +{ + "name": "Zipline Codespace", + "dockerComposeFile": "docker-compose.yml", + "service": "app", + "workspaceFolder": "/workspace", + "forwardPorts": [3000, 5432], + "features": { + "ghcr.io/devcontainers/features/common-utils:2": {}, + "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}, + "ghcr.io/devcontainers/features/node:1": {} + }, + "customizations": { + "vscode": { + "settings": { + "[typescript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[typescriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true, + "files.autoSave": "afterDelay" + }, + "extensions": ["prisma.prisma", "esbenp.prettier-vscode", "dbaeumer.vscode-eslint"] + } + }, + "remoteUser": "zipline", + "remoteEnv": { + "CORE_DATABASE_URL": "postgres://postgres:postgres@localhost/zip10" + }, + "portsAttributes": { + "3000": { + "label": "Zipline", + "onAutoForward": "openBrowser" + }, + "5432": { + "label": "Postgres" + } + } +} diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml new file mode 100644 index 0000000..056c5f1 --- /dev/null +++ b/.devcontainer/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' +services: + app: + image: mcr.microsoft.com/vscode/devcontainers/javascript-node:0-18 + volumes: + - ..:/workspace:cached + network_mode: service:db + command: sleep infinity + user: zipline + db: + image: postgres:latest + restart: unless-stopped + environment: + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=postgres + - POSTGRES_DATABASE=postgres + volumes: + - pg_data:/var/lib/postgresql/data + +volumes: + pg_data: + \ No newline at end of file