Skip to content

Commit cdc70f9

Browse files
committed
added NodeJS container
1 parent 05297f0 commit cdc70f9

File tree

4 files changed

+76
-1
lines changed

4 files changed

+76
-1
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
name: Build NodeJS container
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
jobs:
9+
build_container:
10+
name: Build NodeJS container
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: Login to GitHub Packages Docker Registry
16+
uses: docker/login-action@v1
17+
with:
18+
registry: ghcr.io
19+
username: devops-podkrepi-bg
20+
password: ${{ secrets.DEVOPS_PACKAGES_TOKEN }}
21+
22+
- name: Get tag
23+
id: vars
24+
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
25+
26+
- name: Build and push
27+
uses: docker/build-push-action@v2
28+
with:
29+
context: nodejs
30+
push: true
31+
tags: ghcr.io/podkrepi-bg/nodejs-devcontainer:${{ steps.vars.outputs.tag }}

go/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The easiest way to start developing Go modules for Podkrepi.bg is by using [Visu
1111
```json
1212
{
1313
"name": "Go",
14-
"image": "ghcr.io/podkrepi-bg/go-devcontainer:v1.0.0",
14+
"image": "ghcr.io/podkrepi-bg/go-devcontainer:v1.1.0",
1515
"settings": {
1616
"go.useLanguageServer": true
1717
},

nodejs/Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM node:16.9-alpine3.14
2+
3+
RUN apk --no-cache add curl git zsh sudo docker-cli docker-compose
4+
5+
ENV TERM xterm
6+
ENV SHELL /bin/zsh
7+
RUN wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh || true

nodejs/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Setup for NodeJS development
2+
Currently, all modules within Podkrepi.bg are built using NodeJS 16. [Yarn](https://yarnpkg.com/) is used as a package manager.
3+
4+
- [Visual Studio Code setup](#visual-studio-code-setup)
5+
- [Github Workflows](#github-workflows)
6+
7+
## Visual Studio Code setup
8+
The easiest way to start developing NodeJS modules for Podkrepi.bg is by using [Visual Studio Code](https://code.visualstudio.com/download). Make sure the [Remote Containers extension](https://code.visualstudio.com/docs/remote/containers) is installed. It provides an easy way to configure a container as a [development environment](https://code.visualstudio.com/docs/remote/containers). This can be done by adding a `.devcontainer/devcontainer.json` to the root of the workspace. In most cases, it is sufficient to copy the contents of this example:
9+
10+
```json
11+
{
12+
"name": "NodeJS",
13+
"image": "ghcr.io/podkrepi-bg/nodejs-devcontainer:v1.1.0",
14+
"forwardPorts": [], // Forward ports
15+
"containerEnv": {
16+
"DATABASE_URL": "postgres://postgres:[email protected]:5432/postgres?schema=api" // Custom env vars
17+
},
18+
"postStartCommand": "yarn", // Install dependencies
19+
"extensions": [
20+
"ms-azuretools.vscode-docker",
21+
"nrwl.angular-console",
22+
"esbenp.prettier-vscode",
23+
"firsttris.vscode-jest-runner",
24+
"dbaeumer.vscode-eslint"
25+
],
26+
"mounts": [
27+
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"
28+
]
29+
}
30+
```
31+
32+
## Github Workflows
33+
TODO
34+
35+
36+
37+

0 commit comments

Comments
 (0)