forked from toeverything/AFFiNE
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add devcontainer config (toeverything#4974)
Co-authored-by: Reese <[email protected]>
- Loading branch information
Showing
6 changed files
with
86 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,9 @@ | ||
FROM mcr.microsoft.com/devcontainers/base:bookworm | ||
|
||
# Install Homebrew For Linux | ||
RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" && \ | ||
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" && \ | ||
echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> /home/vscode/.zshrc && \ | ||
echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> /home/vscode/.bashrc && \ | ||
# Install Graphite | ||
brew install withgraphite/tap/graphite && gt --version |
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 @@ | ||
#!/bin/bash | ||
# This is a script used by the devcontainer to build the project | ||
|
||
#Enable yarn | ||
corepack enable | ||
corepack prepare yarn@stable --activate | ||
|
||
# install dependencies | ||
yarn install | ||
|
||
# Create database | ||
yarn workspace @affine/server prisma db push |
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,25 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. | ||
{ | ||
"name": "Debian", | ||
"dockerComposeFile": "docker-compose.yml", | ||
"service": "app", | ||
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", | ||
"features": { | ||
"ghcr.io/devcontainers/features/node:1": { | ||
"version": "18" | ||
}, | ||
"ghcr.io/devcontainers/features/rust:1": {} | ||
}, | ||
// Configure tool-specific properties. | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-playwright.playwright", | ||
"esbenp.prettier-vscode", | ||
"streetsidesoftware.code-spell-checker" | ||
] | ||
} | ||
}, | ||
"updateContentCommand": "bash ./.devcontainer/build.sh", | ||
"postCreateCommand": "bash ./.devcontainer/setup-user.sh" | ||
} |
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,26 @@ | ||
version: '3.8' | ||
|
||
services: | ||
app: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
volumes: | ||
- ../..:/workspaces:cached | ||
command: sleep infinity | ||
network_mode: service:db | ||
environment: | ||
DATABASE_URL: postgresql://affine:affine@db:5432/affine | ||
|
||
db: | ||
image: postgres:latest | ||
restart: unless-stopped | ||
volumes: | ||
- postgres-data:/var/lib/postgresql/data | ||
environment: | ||
POSTGRES_PASSWORD: affine | ||
POSTGRES_USER: affine | ||
POSTGRES_DB: affine | ||
|
||
volumes: | ||
postgres-data: |
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,7 @@ | ||
if [ -v GRAPHITE_TOKEN ];then | ||
gt auth --token $GRAPHITE_TOKEN | ||
fi | ||
|
||
git fetch | ||
git branch canary -t origin/canary | ||
gt init --trunk canary |
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