Skip to content

Commit

Permalink
Fix devcontainer (#85)
Browse files Browse the repository at this point in the history
* Use bullseye image

* Disable port forwading using docker compose files

* Use py version in container names

* Use node image and install python in it

* Use platform linux in docker compose

* Use amd64

* Revert unnecessary changes

* Expose webscoket port alone of nats

* Use forwardPorts to mount nats port
  • Loading branch information
kumaranvpl authored Apr 26, 2024
1 parent 2c897ca commit d4edd8d
Show file tree
Hide file tree
Showing 11 changed files with 70 additions and 34 deletions.
3 changes: 3 additions & 0 deletions .devcontainer/devcontainer.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PORT_PREFIX=${PORT_PREFIX}
CONTAINER_PREFIX=${USER}
DATABASE_URL="postgresql://admin:password@${USER}-postgres-py310-fastagency:5432/fastagency"
3 changes: 3 additions & 0 deletions .devcontainer/python-3.10/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"./docker-compose.yml"
],
"service": "python-3.10",
"forwardPorts": [
"${containerEnv:CONTAINER_PREFIX}-nats-py310-fastagency:9222"
],
"shutdownAction": "stopCompose",
"workspaceFolder": "/workspaces/fastagency",
// "runArgs": [],
Expand Down
19 changes: 11 additions & 8 deletions .devcontainer/python-3.10/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,35 @@ version: '3'
services:
python-3.10: # nosemgrep
image: mcr.microsoft.com/devcontainers/python:3.10
container_name: $USER-python-3.10
container_name: $USER-python-3.10-fastagency
volumes:
- ../../:/workspaces/fastagency:cached
command: sleep infinity
env_file:
- ../devcontainer.env
platform: linux/amd64
networks:
- fastagency-network
nats-fastagency: # nosemgrep
image: nats:latest
container_name: $USER-nats-fastagency
ports:
- "${PORT_PREFIX}4222:4222"
- "${PORT_PREFIX}9222:9222"
container_name: $USER-nats-py310-fastagency
# ports:
# - "${PORT_PREFIX}4222:4222"
# - "${PORT_PREFIX}9222:9222"
volumes:
- ../../examples/nats/server.conf:/etc/nats/server.conf
command: [ "--config", "/etc/nats/server.conf" ]
networks:
- fastagency-network
postgres-fastagency: # nosemgrep
image: postgres:latest
container_name: $USER-postgres-fastagency
container_name: $USER-postgres-py310-fastagency
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: password # pragma: allowlist secret
POSTGRES_DB: fastagency
ports:
- "${PORT_PREFIX}5432:5432"
# ports:
# - "${PORT_PREFIX}5432:5432"
networks:
- fastagency-network

Expand Down
3 changes: 3 additions & 0 deletions .devcontainer/python-3.11/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"./docker-compose.yml"
],
"service": "python-3.11",
"forwardPorts": [
"${containerEnv:CONTAINER_PREFIX}-nats-py310-fastagency:9222"
],
"shutdownAction": "stopCompose",
"workspaceFolder": "/workspaces/fastagency",
// "runArgs": [],
Expand Down
16 changes: 8 additions & 8 deletions .devcontainer/python-3.11/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,32 @@ version: '3'
services:
python-3.11: # nosemgrep
image: mcr.microsoft.com/devcontainers/python:3.11
container_name: $USER-python-3.11
container_name: $USER-python-3.11-fastagency
volumes:
- ../../:/workspaces/fastagency:cached
command: sleep infinity
networks:
- fastagency-network
nats-fastagency: # nosemgrep
image: nats:latest
container_name: $USER-nats-fastagency
ports:
- "${PORT_PREFIX}4222:4222"
- "${PORT_PREFIX}9222:9222"
container_name: $USER-nats-py311-fastagency
# ports:
# - "${PORT_PREFIX}4222:4222"
# - "${PORT_PREFIX}9222:9222"
volumes:
- ../../examples/nats/server.conf:/etc/nats/server.conf
command: [ "--config", "/etc/nats/server.conf" ]
networks:
- fastagency-network
postgres-fastagency: # nosemgrep
image: postgres:latest
container_name: $USER-postgres-fastagency
container_name: $USER-postgres-py311-fastagency
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: password # pragma: allowlist secret
POSTGRES_DB: fastagency
ports:
- "${PORT_PREFIX}5432:5432"
# ports:
# - "${PORT_PREFIX}5432:5432"
networks:
- fastagency-network

Expand Down
3 changes: 3 additions & 0 deletions .devcontainer/python-3.12/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"./docker-compose.yml"
],
"service": "python-3.12",
"forwardPorts": [
"${containerEnv:CONTAINER_PREFIX}-nats-py310-fastagency:9222"
],
"shutdownAction": "stopCompose",
"workspaceFolder": "/workspaces/fastagency",
// "runArgs": [],
Expand Down
16 changes: 8 additions & 8 deletions .devcontainer/python-3.12/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,32 @@ version: '3'
services:
python-3.12: # nosemgrep
image: mcr.microsoft.com/devcontainers/python:3.12
container_name: $USER-python-3.12
container_name: $USER-python-3.12-fastagency
volumes:
- ../../:/workspaces/fastagency:cached
command: sleep infinity
networks:
- fastagency-network
nats-fastagency: # nosemgrep
image: nats:latest
container_name: $USER-nats-fastagency
ports:
- "${PORT_PREFIX}4222:4222"
- "${PORT_PREFIX}9222:9222"
container_name: $USER-nats-py312-fastagency
# ports:
# - "${PORT_PREFIX}4222:4222"
# - "${PORT_PREFIX}9222:9222"
volumes:
- ../../examples/nats/server.conf:/etc/nats/server.conf
command: [ "--config", "/etc/nats/server.conf" ]
networks:
- fastagency-network
postgres-fastagency: # nosemgrep
image: postgres:latest
container_name: $USER-postgres-fastagency
container_name: $USER-postgres-py312-fastagency
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: password # pragma: allowlist secret
POSTGRES_DB: fastagency
ports:
- "${PORT_PREFIX}5432:5432"
# ports:
# - "${PORT_PREFIX}5432:5432"
networks:
- fastagency-network

Expand Down
3 changes: 3 additions & 0 deletions .devcontainer/python-3.9/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"./docker-compose.yml"
],
"service": "python-3.9",
"forwardPorts": [
"${containerEnv:CONTAINER_PREFIX}-nats-py310-fastagency:9222"
],
"shutdownAction": "stopCompose",
"workspaceFolder": "/workspaces/fastagency",
// "runArgs": [],
Expand Down
16 changes: 8 additions & 8 deletions .devcontainer/python-3.9/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,32 @@ version: '3'
services:
python-3.9: # nosemgrep
image: mcr.microsoft.com/devcontainers/python:3.9
container_name: $USER-python-3.9
container_name: $USER-python-3.9-fastagency
volumes:
- ../../:/workspaces/fastagency:cached
command: sleep infinity
networks:
- fastagency-network
nats-fastagency: # nosemgrep
image: nats:latest
container_name: $USER-nats-fastagency
ports:
- "${PORT_PREFIX}4222:4222"
- "${PORT_PREFIX}9222:9222"
container_name: $USER-nats-py39-fastagency
# ports:
# - "${PORT_PREFIX}4222:4222"
# - "${PORT_PREFIX}9222:9222"
volumes:
- ../../examples/nats/server.conf:/etc/nats/server.conf
command: [ "--config", "/etc/nats/server.conf" ]
networks:
- fastagency-network
postgres-fastagency: # nosemgrep
image: postgres:latest
container_name: $USER-postgres-fastagency
container_name: $USER-postgres-py39-fastagency
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: password # pragma: allowlist secret
POSTGRES_DB: fastagency
ports:
- "${PORT_PREFIX}5432:5432"
# ports:
# - "${PORT_PREFIX}5432:5432"
networks:
- fastagency-network

Expand Down
3 changes: 3 additions & 0 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ pip install -e ".[dev]"

# install pre-commit hook if not installed already
pre-commit install

# install wasp
curl -sSL https://get.wasp-lang.dev/installer.sh | sh
19 changes: 17 additions & 2 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@
{
"path": "detect_secrets.filters.allowlist.is_line_allowlisted"
},
{
"path": "detect_secrets.filters.common.is_baseline_file",
"filename": ".secrets.baseline"
},
{
"path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
"min_level": 2
Expand Down Expand Up @@ -107,6 +111,17 @@
"path": "detect_secrets.filters.heuristic.is_templated_secret"
}
],
"results": {},
"generated_at": "2023-12-23T23:23:00Z"
"results": {
".devcontainer/devcontainer.env": [
{
"type": "Basic Auth Credentials",
"filename": ".devcontainer/devcontainer.env",
"hashed_secret": "5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8",
"is_verified": false,
"line_number": 3,
"is_secret": false
}
]
},
"generated_at": "2024-04-25T08:32:26Z"
}

0 comments on commit d4edd8d

Please sign in to comment.