Skip to content

Commit 2cf917f

Browse files
committed
add containerization
1 parent 617af1b commit 2cf917f

File tree

4 files changed

+93
-1
lines changed

4 files changed

+93
-1
lines changed

.github/workflows/docker.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
workflow_dispatch:
6+
7+
jobs:
8+
docker:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Docker meta
12+
id: meta
13+
uses: docker/metadata-action@v5
14+
with:
15+
# list of Docker images to use as base name for tags
16+
images: |
17+
androz2091/slash-commands-gui
18+
# generate Docker tags based on the following events/attributes
19+
tags: |
20+
type=schedule
21+
type=ref,event=branch
22+
type=ref,event=pr
23+
type=semver,pattern={{version}}
24+
type=semver,pattern={{major}}.{{minor}}
25+
type=semver,pattern={{major}}
26+
type=sha
27+
-
28+
name: Set up QEMU
29+
uses: docker/setup-qemu-action@v3
30+
-
31+
name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@v3
33+
-
34+
name: Login to Docker Hub
35+
uses: docker/login-action@v3
36+
with:
37+
username: ${{ secrets.DOCKERHUB_USERNAME }}
38+
password: ${{ secrets.DOCKERHUB_TOKEN }}
39+
-
40+
name: Build and push
41+
uses: docker/build-push-action@v6
42+
with:
43+
push: true
44+
tags: ${{ steps.meta.outputs.tags }}
45+
labels: ${{ steps.meta.outputs.labels }}

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"editor.codeActionsOnSave": {
3-
"source.fixAll.eslint": true
3+
"source.fixAll.eslint": "explicit"
44
},
55
"eslint.validate": ["javascript"],
66
"css.lint.unknownAtRules": "ignore"

Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM node:20.4.0-alpine AS build
2+
WORKDIR /usr/local/app
3+
COPY package.json yarn.lock ./
4+
RUN yarn install
5+
COPY . .
6+
RUN yarn build
7+
8+
FROM nginx:alpine
9+
COPY nginx.conf /etc/nginx/nginx.conf
10+
COPY --from=build /usr/local/app/dist /usr/share/nginx/html

nginx.conf

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
user nginx;
2+
worker_processes auto;
3+
4+
error_log /var/log/nginx/error.log notice;
5+
pid /var/run/nginx.pid;
6+
7+
8+
events {
9+
worker_connections 1024;
10+
}
11+
12+
13+
http {
14+
include /etc/nginx/mime.types;
15+
default_type application/octet-stream;
16+
17+
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
18+
'$status $body_bytes_sent "$http_referer" '
19+
'"$http_user_agent" "$http_x_forwarded_for"';
20+
21+
access_log /var/log/nginx/access.log main;
22+
23+
sendfile on;
24+
25+
keepalive_timeout 65;
26+
27+
gzip on;
28+
29+
server {
30+
listen 80;
31+
listen [::]:80;
32+
root /usr/share/nginx/html;
33+
location / {
34+
try_files $uri $uri/ /index.html;
35+
}
36+
}
37+
}

0 commit comments

Comments
 (0)