mirror of
https://github.com/Kizuren/statusPage.git
synced 2025-12-21 13:06:08 +01:00
Added docker (refs #1)
This commit is contained in:
parent
72b8079e8a
commit
1b55a94b17
4 changed files with 71 additions and 0 deletions
38
.github/workflows/build.yml
vendored
Normal file
38
.github/workflows/build.yml
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
name: Build Docker Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
# Manual trigger
|
||||||
|
release:
|
||||||
|
types: [created]
|
||||||
|
# Automatic trigger on release creation
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
platforms: linux/amd64, linux/arm64/v8, linux/arm/v7
|
||||||
|
tags: ghcr.io/marcus7i/statuspage:${{ github.ref_name }},ghcr.io/marcus7i/statuspage:latest
|
||||||
15
Dockerfile
Normal file
15
Dockerfile
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
FROM node:18-alpine
|
||||||
|
|
||||||
|
RUN npm install -g http-server
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package*.json ./
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
VOLUME /app/config.js
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
RUN echo '#!/bin/sh\nnode watcher.js & http-server ./static -p 8080\n' > /app/start.sh && \
|
||||||
|
chmod +x /app/start.sh
|
||||||
|
CMD ["/app/start.sh"]
|
||||||
9
docker-compose-build.yml
Normal file
9
docker-compose-build.yml
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
ports:
|
||||||
|
- "8080:8080"
|
||||||
|
volumes:
|
||||||
|
- ./config.js:/app/config.js
|
||||||
9
docker-compose.yml
Normal file
9
docker-compose.yml
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
services:
|
||||||
|
statuspage:
|
||||||
|
image: ghcr.io/marcus7i/statuspage:latest
|
||||||
|
container_name: statuspage
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- "8080:8080"
|
||||||
|
volumes:
|
||||||
|
- ./config.js:/app/config.js
|
||||||
Loading…
Add table
Add a link
Reference in a new issue