Skip to content

Commit

Permalink
🧑‍💻 devcontainer settings
Browse files Browse the repository at this point in the history
  • Loading branch information
tktcorporation committed Oct 10, 2022
1 parent 458354c commit 5647ac6
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 1 deletion.
52 changes: 52 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "redwoodjs-v3-tutrial-2nd",
"image": "mcr.microsoft.com/vscode/devcontainers/universal:linux",

// Set *default* container specific settings.json values on container create.
"settings": {
"runOnSave.commands": [
{
"globMatch": "**/*",
"command": "docker-compose exec -T app /bin/bash -c \"dum rw lint --fix\"",
"runIn": "backend"
}
]
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-azuretools.vscode-docker",
"GitHub.copilot",
"donjayamanne.githistory",
"eamodio.gitlens",
"mhutchie.git-graph",
"steoates.autoimport",
"pucelle.run-on-save",
"Prisma.prisma",
"WallabyJs.console-ninja",
"antfu.iconify",
"Atishay-Jain.All-Autocomplete",
"usernamehw.errorlens",
"GraphQL.vscode-graphql",
"dbaeumer.vscode-eslint",
"eamodio.gitlens",
"ofhumanbondage.react-proptypes-intellisense",
"mgmcdermott.vscode-language-babel",
"wix.vscode-import-cost",
"pflannery.vscode-versionlens",
"editorconfig.editorconfig",
"prisma.prisma",
"WakaTime.vscode-wakatime"
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "gh extension install davidraviv/gh-clean-branches",

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"features": {
"homebrew": "latest"
}
}
2 changes: 1 addition & 1 deletion .env.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# into version control.

# schema.prisma defaults
DATABASE_URL=file:./dev.db
# DATABASE_URL=file:./dev.db

# location of the test database for api service scenarios (defaults to ./.redwood/test.db if not set)
# TEST_DATABASE_URL=file:./.redwood/test.db
Expand Down
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM node:18.10.0-bullseye-slim AS build-env

ENV LC_ALL=C.UTF-8

RUN apt-get update && \
apt-get install -y \
curl \
git

RUN curl -sSL https://bina.egoist.sh/egoist/dum | bash
42 changes: 42 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
version: "3.8"
services:
app:
command: /bin/bash -c "dum i && dum rw dev"
build: .
working_dir: /app
volumes:
- .:/app
environment:
- RWJS_DEV_API_URL=${RWJS_DEV_API_URL:-http://localhost}
- SESSION_SECRET=${SESSION_SECRET:-dummy}
- DATABASE_URL=postgres://postgres:postgres@db:5432/postgres?connection_limit=1
- TEST_DATABASE_URL=postgres://postgres:postgres@db-test:5432/postgres_test?connection_limit=1
ports:
- "7910:7910" # storybook
- "8910:8910" # redwoodjs web
- "8911:8911"
- "18911:18911"
- "5555:5555"
depends_on:
- db
- db-test
db:
image: postgres:14
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
volumes:
- ./redwoodblog/.db/data:/var/lib/postgresql/data
ports:
- "5432:5432"
db-test:
image: postgres:14
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres_test
volumes:
- ./redwoodblog/.db/data-test:/var/lib/postgresql/data
ports:
- "5433:5432"

0 comments on commit 5647ac6

Please sign in to comment.