Skip to content

Commit

Permalink
feat: add devcontainers
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosthe19916 committed Dec 30, 2024
1 parent d9a005a commit e3e020b
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .devcontainer/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
TRUSTIFY_API_URL=http://backend:8080
OIDC_SERVER_URL=http://backend:8090/realms/trustify
1 change: 1 addition & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM mcr.microsoft.com/devcontainers/base:ubuntu
27 changes: 27 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "trustify-ui",
"dockerComposeFile": "docker-compose.yml",
"service": "frontend",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/node:1": {
"version": "20"
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
3000
],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "bash .devcontainer/postCreateCommand.sh",
// Configure tool-specific properties.
"customizations": {
"jetbrains": {
"backend": "WebStorm"
}
},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
"remoteUser": "root"
}
15 changes: 15 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
networks:
trustification:

services:
frontend:
build:
context: .
dockerfile: Dockerfile
env_file:
- .env
volumes:
- ../..:/workspaces:cached
command: sleep infinity
networks:
- trustification
7 changes: 7 additions & 0 deletions .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apt-get update

## Git autocomplete
echo "source /usr/share/bash-completion/completions/git" >> ~/.bashrc

## Install dependencies
npm ci --ignore-scripts

0 comments on commit e3e020b

Please sign in to comment.