Skip to content

Commit

Permalink
feat: start move to devcontainers
Browse files Browse the repository at this point in the history
  • Loading branch information
josmo committed Jan 28, 2024
1 parent be2fb54 commit a11bc35
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 9 deletions.
44 changes: 44 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node
{
"name": "Node.js",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/javascript-node:0-20-bullseye",

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
"settings": {},
"extensions": [
"streetsidesoftware.code-spell-checker"
]
}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [3000,7007],

// Use 'portsAttributes' to set default properties for specific forwarded ports.
// More info: https://containers.dev/implementors/json_reference/#port-attributes
"portsAttributes": {
"3000": {
"label": "front",
"onAutoForward": "notify"
},
"7007": {
"label": "api",
"onAutoForward": "notify"
}
},

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "yarn install"

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
18 changes: 12 additions & 6 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,19 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set Node.js
uses: actions/setup-node@v3
- name: Run make ci-build in dev container
uses: devcontainers/[email protected]
with:
node-version: 18.x
- name: yarn
run: yarn install --frozen-lockfile && yarn tsc && yarn build:all
shell: bash
# [Optional] If you have a separate workflow like the one above
# to pre-build your container image, you can reference it here
# to speed up your application build workflows as well!
cacheFrom: ghcr.io/example/example-devcontainer
push: never
runCmd: |
yarn install --frozen-lockfile
yarn tsc
yarn build:all
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .run/dev.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<scripts>
<script value="dev" />
</scripts>
<node-interpreter value="$USER_HOME$/.nvm/versions/node/v18.14.2/bin/node" />
<node-interpreter value="node" />
<envs />
<method v="2" />
</configuration>
Expand Down
4 changes: 2 additions & 2 deletions app-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
app:
title: default title
baseUrl: http://localhost:3000
baseUrl: http://127.0.0.1:3000

organization:
name: default org name
Expand All @@ -12,7 +12,7 @@ backend:
# auth:
# keys:
# - secret: ${BACKEND_SECRET}
baseUrl: http://localhost:7007
baseUrl: http://127.0.0.1:7007
listen:
port: 7007
# Uncomment the following host directive to bind to specific interfaces
Expand Down

0 comments on commit a11bc35

Please sign in to comment.