Skip to content

Commit

Permalink
added NodeJS container
Browse files Browse the repository at this point in the history
  • Loading branch information
imilchev committed Sep 22, 2021
1 parent 05297f0 commit cdc70f9
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 1 deletion.
31 changes: 31 additions & 0 deletions .github/workflows/nodejs-container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

name: Build NodeJS container
on:
push:
tags:
- 'v*.*.*'

jobs:
build_container:
name: Build NodeJS container
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Login to GitHub Packages Docker Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: devops-podkrepi-bg
password: ${{ secrets.DEVOPS_PACKAGES_TOKEN }}

- name: Get tag
id: vars
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}

- name: Build and push
uses: docker/build-push-action@v2
with:
context: nodejs
push: true
tags: ghcr.io/podkrepi-bg/nodejs-devcontainer:${{ steps.vars.outputs.tag }}
2 changes: 1 addition & 1 deletion go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The easiest way to start developing Go modules for Podkrepi.bg is by using [Visu
```json
{
"name": "Go",
"image": "ghcr.io/podkrepi-bg/go-devcontainer:v1.0.0",
"image": "ghcr.io/podkrepi-bg/go-devcontainer:v1.1.0",
"settings": {
"go.useLanguageServer": true
},
Expand Down
7 changes: 7 additions & 0 deletions nodejs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM node:16.9-alpine3.14

RUN apk --no-cache add curl git zsh sudo docker-cli docker-compose

ENV TERM xterm
ENV SHELL /bin/zsh
RUN wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh || true
37 changes: 37 additions & 0 deletions nodejs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Setup for NodeJS development
Currently, all modules within Podkrepi.bg are built using NodeJS 16. [Yarn](https://yarnpkg.com/) is used as a package manager.

- [Visual Studio Code setup](#visual-studio-code-setup)
- [Github Workflows](#github-workflows)

## Visual Studio Code setup
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:

```json
{
"name": "NodeJS",
"image": "ghcr.io/podkrepi-bg/nodejs-devcontainer:v1.1.0",
"forwardPorts": [], // Forward ports
"containerEnv": {
"DATABASE_URL": "postgres://postgres:[email protected]:5432/postgres?schema=api" // Custom env vars
},
"postStartCommand": "yarn", // Install dependencies
"extensions": [
"ms-azuretools.vscode-docker",
"nrwl.angular-console",
"esbenp.prettier-vscode",
"firsttris.vscode-jest-runner",
"dbaeumer.vscode-eslint"
],
"mounts": [
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"
]
}
```

## Github Workflows
TODO




0 comments on commit cdc70f9

Please sign in to comment.