-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
183 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,14 @@ | ||
FROM mcr.microsoft.com/devcontainers/typescript-node:1-18-bullseye | ||
|
||
# [Optional] Uncomment this section to install additional OS packages. | ||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
&& apt-get -y install --no-install-recommends git-cola | ||
|
||
# [Optional] Uncomment if you want to install an additional version of node using nvm | ||
# ARG EXTRA_NODE_VERSION=10 | ||
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}" | ||
|
||
# [Optional] Uncomment if you want to install more global node modules | ||
RUN su node -c "npm install -g prisma" | ||
|
||
RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.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,73 @@ | ||
{ | ||
"name": "next-boilerplate", | ||
|
||
// Update the 'dockerComposeFile' list if you have more compose files or use different names. | ||
// The .devcontainer/docker-compose.yml file contains any overrides you need/want to make. | ||
"dockerComposeFile": "docker-compose.yml", | ||
|
||
// The 'service' property is the name of the service for the container that VS Code should | ||
// use. Update this value and .devcontainer/docker-compose.yml to the real service name. | ||
"service": "app", | ||
"runServices": ["redis", "db"], | ||
|
||
// The optional 'workspaceFolder' property is the path VS Code should open by default when | ||
// connected. This is typically a file mount in .devcontainer/docker-compose.yml | ||
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
"forwardPorts": [3000, 5432, 6379, 6080], | ||
|
||
"portsAttributes": { | ||
"3000": { | ||
"label": "nextjs" | ||
}, | ||
"5432": { | ||
"label": "postgres" | ||
}, | ||
"6379": { | ||
"label": "redis" | ||
}, | ||
"6080": { | ||
"label": "desktop" | ||
} | ||
}, | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
"postCreateCommand": "npm install && ./scripts/install-brew.sh", | ||
|
||
// Configure tool-specific properties. | ||
"customizations": { | ||
"postCreateCommand": "npm install && ./scripts/install-brew.sh", | ||
"vscode": { | ||
"extensions": [ | ||
"formulahendry.auto-rename-tag", | ||
"aaron-bond.better-comments", | ||
"WallabyJs.console-ninja", | ||
"EditorConfig.EditorConfig", | ||
"dsznajder.es7-react-js-snippets", | ||
"dbaeumer.vscode-eslint", | ||
"tombonnike.vscode-status-bar-format-toggle", | ||
"github.vscode-github-actions", | ||
"GitHub.copilot", | ||
"GitHub.copilot-chat", | ||
"GitHub.copilot-labs", | ||
"eamodio.gitlens", | ||
"ecmel.vscode-html-css", | ||
"Zignd.html-css-class-completion", | ||
"yzhang.markdown-all-in-one", | ||
"esbenp.prettier-vscode", | ||
"rvest.vs-code-prettier-eslint", | ||
"Prisma.prisma", | ||
"bradlc.vscode-tailwindcss", | ||
"donjayamanne.githistory", | ||
"ms-azuretools.vscode-docker" | ||
] | ||
} | ||
}, | ||
"features": { | ||
"ghcr.io/devcontainers/features/desktop-lite:1": {} | ||
} | ||
|
||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} |
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,48 @@ | ||
version: "3.8" | ||
|
||
services: | ||
app: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
|
||
volumes: | ||
- ../..:/workspaces:cached | ||
|
||
# Overrides default command so things don't shut down after the process ends. | ||
command: sleep infinity | ||
|
||
# Use "forwardPorts" in **devcontainer.json** to forward an app port locally. | ||
# (Adding the "ports" property to this file will not forward from a Codespace.) | ||
|
||
db: | ||
image: postgres:latest | ||
restart: unless-stopped | ||
volumes: | ||
- postgres-data:/var/lib/postgresql/data | ||
environment: | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_USER: postgres | ||
POSTGRES_DB: postgres | ||
|
||
# Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally. | ||
# (Adding the "ports" property to this file will not forward from a Codespace.) | ||
|
||
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function. | ||
network_mode: service:app | ||
|
||
redis: | ||
image: redis:latest | ||
restart: unless-stopped | ||
volumes: | ||
- redis-data:/data | ||
|
||
# Add "forwardPorts": ["6379"] to **devcontainer.json** to forward Redis locally. | ||
# (Adding the "ports" property to this file will not forward from a Codespace.) | ||
|
||
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function. | ||
network_mode: service:app | ||
|
||
volumes: | ||
postgres-data: | ||
redis-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 @@ | ||
DATABASE_URL="postgresql://johndoe:randompassword@localhost:5432/mydb?schema=public" |
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,18 @@ | ||
name: Code Review | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: anc95/ChatGPT-CodeReview@main | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
OPENAI_API_KEY: "${{ secrets.OPENAI_API_KEY }}" |
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,3 @@ | ||
{ | ||
"recommendations": [] | ||
} |
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 @@ | ||
#! /bin/sh | ||
sudo chown -R $(whoami) /home/linuxbrew/.linuxbrew | ||
(echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> /home/$USER/.bashrc | ||
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" | ||
brew install gcc | ||
brew install pre-commit | ||
pre-commit install -t commit-msg |
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,11 @@ | ||
// This is your Prisma schema file, | ||
// learn more about it in the docs: https://pris.ly/d/prisma-schema | ||
|
||
generator client { | ||
provider = "prisma-client-js" | ||
} | ||
|
||
datasource db { | ||
provider = "postgresql" | ||
url = env("DATABASE_URL") | ||
} |
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,8 @@ | ||
model User { | ||
id Int @id @default(autoincrement()) | ||
username String @unique | ||
email String @unique | ||
password String | ||
createdAt DateTime @default(now()) | ||
updatedAt DateTime @updatedAt | ||
} |