Skip to content

Commit 59976a5

Browse files
committed
Add devcontainer for Docker development
1 parent c8c5b9d commit 59976a5

File tree

3 files changed

+71
-0
lines changed

3 files changed

+71
-0
lines changed

.devcontainer/Dockerfile

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM ruby:3.2.2-slim-bullseye
2+
3+
ENV TZ="Europe/London"
4+
5+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
6+
&& apt-get -y install --no-install-recommends \
7+
apt-utils \
8+
build-essential \
9+
curl \
10+
git \
11+
vim \
12+
zsh
13+
14+
RUN gem install bundler
15+
16+
WORKDIR /workspace

.devcontainer/devcontainer.json

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/ruby-rails-postgres
3+
// Update the VARIANT arg in docker-compose.yml to pick a Ruby version
4+
{
5+
"name": "ruby-openai",
6+
"dockerComposeFile": "docker-compose.yml",
7+
"service": "app",
8+
"workspaceFolder": "/workspace",
9+
"containerEnv": {
10+
"GITHUB_TOKEN": "${localEnv:GITHUB_TOKEN}",
11+
"GITHUB_USER": "${localEnv:GITHUB_USER}"
12+
},
13+
// Configure tool-specific properties.
14+
"customizations": {
15+
// Configure properties specific to VS Code.
16+
"vscode": {
17+
// Add the IDs of extensions you want installed when the container is created.
18+
"extensions": [
19+
"rebornix.Ruby",
20+
"sleistner.vscode-fileutils",
21+
"ms-azuretools.vscode-docker",
22+
"samverschueren.final-newline",
23+
"GitHub.copilot",
24+
"usernamehw.remove-empty-lines",
25+
"wingrunr21.vscode-ruby",
26+
]
27+
}
28+
},
29+
// Use 'postCreateCommand' to run commands after the container is created.
30+
"postCreateCommand": "bundle install",
31+
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
32+
"features": {
33+
"git": "os-provided",
34+
"github-cli": "latest"
35+
}
36+
}

.devcontainer/docker-compose.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: "3"
2+
3+
services:
4+
app:
5+
build:
6+
context: ..
7+
dockerfile: .devcontainer/Dockerfile
8+
9+
volumes:
10+
- ..:/workspace:cached
11+
- bundle_cache:/bundle
12+
13+
command: sleep infinity
14+
15+
environment:
16+
TZ: Europe/London
17+
18+
volumes:
19+
bundle_cache:

0 commit comments

Comments
 (0)