Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
vicwere committed Feb 21, 2024

Verified

This commit was signed with the committer’s verified signature.
fpapado Fotis Papadogeorgopoulos
2 parents 337900f + 8630c40 commit 2bd0db5
Showing 4 changed files with 198 additions and 11,197 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: deploying to test instance

on:
push:
branches: [master]

jobs:
deploy:
name: Performing remote connection
runs-on: ubuntu-latest

steps:
- name: Remote Connection Setup
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.CICD2_HOST }}
username: ${{ secrets.CICD2_USERNAME }}
key: ${{ secrets.CICD2_SECRET }}
port: ${{ secrets.PORT }}
script: |
# Set up deployment directory
deploy_dir="/apps/github-workflows/mhealth-apps/kenyaemr_visualization_reciever"
sudo rm -rf "$deploy_dir"
sudo mkdir "$deploy_dir"
sudo chown -R cicd2:cicd2 "$deploy_dir"
# Clone repository
git config --global --add safe.directory "$deploy_dir"
git clone -b master https://github.com/palladiumkenya/kenyaemr_visualization_receiver.git "$deploy_dir"
# Copy configuration files
cp /apps/configs/kvisual/.env "$deploy_dir/"
# Build and run Docker container
docker stop kvisual
docker rm -f kvisual
docker build --no-cache -t kvisual:latest "$deploy_dir"
docker run -p 7008:5000 --name kvisual -d --restart always --security-opt=no-new-privileges --log-opt max-size=10m \
--log-opt max-file=3 kvisual:latest
19 changes: 14 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
FROM node:12
FROM node:20.11.1-bullseye-slim

WORKDIR /app
COPY package.json /app
RUN npm install
COPY . /app
CMD ["npm", "start"]

COPY package*.json ./

RUN npm install && npm cache clean --force

COPY . .

EXPOSE 5000

ENV NODE_ENV=production

CMD ["node", "index.js"]
Loading

0 comments on commit 2bd0db5

Please sign in to comment.