Skip to content

Commit

Permalink
Merge pull request #4 from lnls-sirius/rads
Browse files Browse the repository at this point in the history
Improve deployment
  • Loading branch information
RafaelLyra8 authored Aug 10, 2023
2 parents f44cc8c + 0c6a6de commit ca60367
Show file tree
Hide file tree
Showing 8 changed files with 17,148 additions and 12,603 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Gamma Monitor CD

on:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout 🛎️
uses: actions/checkout@master

- name: Build Docker Compose 🏗️
run: docker-compose build

- name: Login to GitHub Container Registry 🔓
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GAMMA_MON }}

- name: Push Docker Compose 🪖
run: docker-compose push
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM node:19-alpine3.16 AS builder

# General information about the code
LABEL maintainer="SwC <[email protected]>"

# Set the container directories
WORKDIR /app

COPY package*.json ./
COPY . .

# Install the desired packages with npm
RUN npm install
RUN npm run build

FROM nginx:1.24
WORKDIR /usr/share/nginx/html
RUN rm -rf ./*
COPY --from=builder /app/build .
RUN rm /etc/nginx/conf.d/default.conf
COPY nginx/nginx.conf /etc/nginx/conf.d

EXPOSE 80
ENTRYPOINT ["nginx", "-g", "daemon off;"]
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: '3.8'

services:
vacs:
container_name: 'gamma-mon'
image: 'ghcr.io/lnls-sirius/gamma-mon:1.0.1'
build:
context: .
ports:
- 80:80
12 changes: 12 additions & 0 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
server {
listen 80;
location / {
root /usr/share/nginx/html;
index index.html index.html;
try_files $uri $uri/ /index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
Loading

0 comments on commit ca60367

Please sign in to comment.