Skip to content

Commit

Permalink
First tentative step at setting up multi container codespace
Browse files Browse the repository at this point in the history
  • Loading branch information
mrchrisadams committed Nov 17, 2024
1 parent 7b21408 commit 4c1893c
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .devcontainer/codespaces-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: "3.8"

services:
app:
build:
context: ..
image: mcr.microsoft.com/devcontainers/universal:2
volumes:
- ../..:/workspaces:cached
command: sleep infinity
network_mode: service:mariadb

mariadb:
image: mariadb:10.11
environment:
MARIADB_DATABASE: greencheck
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: "true"
restart: unless-stopped

rabbitmq:
image: rabbitmq:3.11
hostname: green-rabbit
privileged: true
restart: unless-stopped

mailhog:
image: mailhog/mailhog
restart: unless-stopped
38 changes: 38 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,47 @@
{
"image": "mcr.microsoft.com/devcontainers/universal:2",
"dockerComposeFile": "codespaces-compose.yml",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"service": "app",
"features": {
"ghcr.io/jsburckhardt/devcontainer-features/uv:1": {},
"ghcr.io/eitsupi/devcontainer-features/just:0": {}
},
"postCreateCommand": "bash .devcontainer/post-create.sh",
"forwardPorts": [
8000,
6379,
5672,
3306,
8025,
1025
],
"portsAttributes": {
"8000": {
"label": "Django App",
"onAutoForward": "ignore"
},
"6379": {
"label": "Redis",
"onAutoForward": "ignore"
},
"5672": {
"label": "RabbitMQ",
"onAutoForward": "ignore"
},
"3306": {
"label": "MariaDB",
"onAutoForward": "ignore"
},
"8025": {
"label": "Mailhog Web",
"onAutoForward": "ignore"
},
"1025": {
"label": "Mailhog SMTP",
"onAutoForward": "ignore"
}
},
"customizations": {
"codespaces": {},
"vscode": {
Expand Down
3 changes: 3 additions & 0 deletions .devcontainer/post-create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

echo "I am run to set up the codespace for development"

0 comments on commit 4c1893c

Please sign in to comment.