Skip to content

Commit 58b7b60

Browse files
committed
Add devenv environment
1 parent 68c88af commit 58b7b60

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed

.devcontainer/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.generated.yaml

.devcontainer/env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ENV=ruby
2+
PORT=2222

.devcontainer/project.temp.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Project specific template (pagy)
2+
3+
spec:
4+
containers:
5+
- env:
6+
# Append the env variable to the ruby container
7+
- (( append ))
8+
- name: CDP_WS_URL
9+
value: ws://127.0.0.1:9222
10+
- name: PATH
11+
value: /opt/tools/bun/bin:/usr/local/bundle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
12+
volumeMounts:
13+
- (( append ))
14+
- name: tools-storage
15+
mountPath: /opt/tools
16+
17+
# Append the lightpanda container to the containers
18+
- (( append ))
19+
- name: lightpanda
20+
image: docker.io/lightpanda/browser:nightly
21+
ports:
22+
- containerPort: 9222
23+
protocol: TCP
24+
25+
volumes:
26+
- (( append ))
27+
- name: tools-storage
28+
persistentVolumeClaim:
29+
claimName: shared_tools
30+

.devcontainer/setup.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
# Setup example for a Project that requires bun
4+
- `podman exec -it <service-name> /%N/.devenv/setup.sh` from the host
5+
- `/<Project-name>/.devenv/setup.sh` from inside a container shell
6+
7+
# 1. Install Bun (to /opt/bun)
8+
if [[ ! -x "/opt/tools/bun/bin/bun" ]]; then
9+
echo ">>> Installing Bun..."
10+
curl -fsSL https://bun.sh/install | BUN_INSTALL=/opt/tools/bun bash
11+
fi
12+
13+
echo ">>> Project environment ready."

0 commit comments

Comments
 (0)