forked from scenic-views/scenic
-
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.
Add devcontainer configuration for Codespaces
This configuration allows Scenic development to be done via Codespaces for anyone with access to that feature on GitHub. Creating a Codespace in this project will drop you into an environment ready to run `rake` and get a fully passing test suite. I personally do this using the `gh` cli, connecting via SSH, but one could also connect via VSCode or the web. Either way, I'm in a fully working environment within 1-2 minutes, which I find helpful when I've stepped away from development work for a bit and can't be bothered to figure out my local environment again. I believe this same configuration should be usable locally for folks who want to use Docker (see scenic-views#319), but that is less interesting to me personally.
- Loading branch information
1 parent
c625d1b
commit f3b8f73
Showing
4 changed files
with
42 additions
and
1 deletion.
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,6 @@ | ||
ARG VARIANT=2-bullseye | ||
FROM mcr.microsoft.com/vscode/devcontainers/ruby:0-${VARIANT} | ||
|
||
ENV RAILS_DEVELOPMENT_HOSTS=".githubpreview.dev" | ||
ENV POSTGRES_USER="postgres" | ||
ENV POSTGRES_PASSWORD="postgres" |
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 @@ | ||
{ | ||
"name": "Scenic Development", | ||
"dockerComposeFile": "docker-compose.yml", | ||
"service": "app", | ||
"workspaceFolder": "/workspace", | ||
"settings": { }, | ||
"extensions": ["rebornix.Ruby"], | ||
"postCreateCommand": "bin/setup", | ||
"remoteUser": "vscode", | ||
"features": { "github-cli": "latest" } | ||
} |
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,24 @@ | ||
version: '3' | ||
|
||
services: | ||
app: | ||
build: | ||
context: .. | ||
dockerfile: .devcontainer/Dockerfile | ||
args: | ||
VARIANT: "3" | ||
volumes: | ||
- ..:/workspace:cached | ||
command: sleep infinity | ||
network_mode: service:db | ||
db: | ||
image: postgres:latest | ||
restart: unless-stopped | ||
volumes: | ||
- postgres-data:/var/lib/postgresql/data | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_DB: postgres | ||
POSTGRES_PASSWORD: postgres | ||
volumes: | ||
postgres-data: null |
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