Skip to content

Commit

Permalink
Initial files to test CI of image to EKS
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjones-plip committed Jan 10, 2024
1 parent b5cc19d commit d9dc3a6
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
43 changes: 43 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Docker build and publish

on: [push, pull_request]

env:
ECR_REPO: 'public.ecr.aws/s5s3h4s7'

jobs:


publish:
needs: e2e-tests
name: Publish Docker image
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}

steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.ECR_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.ECR_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
with:
registry-type: public

- name: Get branch name
uses: nelonoel/branch-name@1ea5c86cb559a8c4e623da7f188496208232e49f
- name: Set ENV
run: |
echo "BUILD_NUMBER=$GITHUB_RUN_ID" >> $GITHUB_ENV
echo "BRANCH=$BRANCH_NAME" >> $GITHUB_ENV
- uses: actions/checkout@v2
- name: Use Node.js 20.x
uses: actions/setup-node@v1
with:
node-version: 20.x
- run: npm run publish
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.idea
node_modules
dist
.env*
src/package.json
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM node:20-alpine

WORKDIR /app

COPY package*.json .
COPY dist ./dist

CMD npm start
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3.7'

services:
cht-user-management:
build:
context: .
environment:
- EXTERNAL_PORT=${EXTERNAL_PORT:-3000}
- COOKIE_PRIVATE_KEY=${COOKIE_PRIVATE_KEY}
- CONFIG_NAME=${CONFIG_NAME}
ports:
- '${EXTERNAL_PORT-3000}:${PORT:-3000}'
restart: always
command: npm start
4 changes: 4 additions & 0 deletions env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
COOKIE_PRIVATE_KEY=
CONFIG_NAME=chis-ke
PORT=3000 # for development environment
EXTERNAL_PORT=3000 # for docker
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "cht-user-management",
"version": "1.0.0",
"main": "dist/index.js",
"scripts": {
"start": "node dist/index.js",
"publish": "node dist/publish.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/medic/cht-user-management.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/medic/cht-user-management/issues"
},
"homepage": "https://github.com/medic/cht-user-management"
}

0 comments on commit d9dc3a6

Please sign in to comment.