Skip to content

Commit

Permalink
Devcontainer adjustments.
Browse files Browse the repository at this point in the history
  • Loading branch information
soup-bowl committed Feb 1, 2025
1 parent f71dc17 commit 96d7d50
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
7 changes: 4 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
{
"name": "Node.js & TypeScript",
"name": "Localib Dev",
"image": "mcr.microsoft.com/devcontainers/typescript-node:18-bullseye",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},
"postCreateCommand": "./.devcontainer/postCreateCommand.sh",
"postStartCommand": "./.devcontainer/postStartCommand.sh",
"postAttachCommand": "./.devcontainer/postAttachCommand.sh",
"forwardPorts": [3000]
"postAttachCommand": ["npm", "run", "serve"],
"forwardPorts": [3000],
"remoteUser": "root"
}
2 changes: 0 additions & 2 deletions .devcontainer/postAttachCommand.sh

This file was deleted.

2 changes: 1 addition & 1 deletion .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /bin/bash
docker-compose -f .github/docker-compose.yml pull
docker-compose -f .github/docker-compose.yml build
npm install
npm ci
10 changes: 9 additions & 1 deletion .devcontainer/postStartCommand.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#! /bin/bash
echo "PUBLIC_URL=https://${CODESPACE_NAME}-3000.preview.app.github.dev" > .env.development.local
if [ ! -z ${GITPOD_HOST+x} ]; then
ACCESS_URL="https://8100-${GITPOD_WORKSPACE_ID}.${GITPOD_WORKSPACE_CLUSTER_HOST}"
elif [ ! -z ${CODESPACE_NAME+x} ]; then
ACCESS_URL="https://${CODESPACE_NAME}-8100.preview.app.github.dev"
else
ACCESS_URL="http://localhost:8100"
fi

echo "PUBLIC_URL=${ACCESS_URL}" > .env.development.local
echo "REACT_APP_VERSION=\$npm_package_version" >> .env.development.local
cp .env.development.local .env.production.local

0 comments on commit 96d7d50

Please sign in to comment.