Skip to content

Commit ad0be9b

Browse files
committed
rewritten to preact and mui
1 parent d458e3a commit ad0be9b

35 files changed

+2434
-4198
lines changed
Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
name: Create and publish the Docker image
1+
name: GitHub-Docker-Publish
22

33
on:
44
workflow_dispatch:
55
push:
66
branches:
77
- "main"
88

9-
#on:
10-
# release:
11-
# types: [published]
12-
# workflow_dispatch:
13-
149
env:
1510
REGISTRY: ghcr.io
1611
IMAGE_NAME: ${{ github.repository }}
@@ -24,25 +19,25 @@ jobs:
2419

2520
steps:
2621
- name: Checkout repository
27-
uses: actions/checkout@v3
22+
uses: actions/checkout@v4
2823

2924
- name: Log in to the Container registry
30-
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
25+
uses: docker/login-action@v3
3126
with:
3227
registry: ${{ env.REGISTRY }}
3328
username: ${{ github.actor }}
3429
password: ${{ secrets.GITHUB_TOKEN }}
3530

3631
- name: Extract metadata (tags, labels) for Docker
3732
id: meta
38-
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
33+
uses: docker/metadata-action@v5
3934
with:
4035
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
4136

4237
- name: Build and push Docker image
43-
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
38+
uses: docker/build-push-action@v6
4439
with:
45-
context: .
40+
context: ./docker
4641
push: true
4742
tags: ${{ steps.meta.outputs.tags }}
4843
labels: ${{ steps.meta.outputs.labels }}

.vscode/extensions.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

Dockerfile

Lines changed: 0 additions & 13 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
11
# QR-Code Generator
2-
3-
## Recommended IDE Setup
4-
5-
[VS Code](https://code.visualstudio.com/) + [Svelte](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode).

docker/Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# build
2+
FROM node:lts AS build
3+
WORKDIR /app
4+
COPY package.json ./
5+
COPY package-lock.json ./
6+
COPY index.html ./
7+
COPY vite.config.js ./
8+
COPY ./public ./public
9+
COPY ./src ./src
10+
RUN npm install
11+
RUN npm run build
12+
13+
# production
14+
FROM nginx:1.27.5-alpine
15+
RUN addgroup -S nonroot && adduser -S nonroot -G nonroot
16+
USER nonroot
17+
COPY --from=build /app/build /usr/share/nginx/html
18+
COPY nginx.conf /etc/nginx/conf.d/default.conf
19+
EXPOSE 80
20+
CMD ["nginx", "-g", "daemon off;"]
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
version: '2.4'
2-
services:
3-
app:
4-
build: ./
5-
container_name: qr-code-generator
6-
restart: on-failure:1
7-
ports:
8-
- 80:80
1+
version: '2.4'
2+
services:
3+
app:
4+
build: ./
5+
container_name: qr-code-generator
6+
restart: on-failure:1
7+
ports:
8+
- 80:80
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
version: '2.4'
2-
services:
3-
app:
4-
image: ghcr.io/docbrown101/qr-code-generator:main
5-
container_name: qr-code-generator
6-
restart: on-failure:1
7-
ports:
8-
- 80:80
9-
user: 1001:1001
10-
security_opt:
11-
- apparmor:docker-default
12-
- no-new-privileges
13-
cpu_shares: 10
14-
pids_limit: 10
15-
mem_limit: 100m
16-
read_only: true
17-
tmpfs:
18-
- /var/run:mode=770,size=512K,uid=1001,gid=1001
19-
- /var/cache/nginx:mode=770,size=512K,uid=1001,gid=1001
1+
version: '2.4'
2+
services:
3+
app:
4+
image: ghcr.io/docbrown101/qr-code-generator:main
5+
container_name: qr-code-generator
6+
restart: on-failure:1
7+
ports:
8+
- 80:80
9+
user: 1001:1001
10+
security_opt:
11+
- apparmor:docker-default
12+
- no-new-privileges
13+
cpu_shares: 10
14+
pids_limit: 10
15+
mem_limit: 100m
16+
read_only: true
17+
tmpfs:
18+
- /var/run:mode=770,size=512K,uid=1001,gid=1001
19+
- /var/cache/nginx:mode=770,size=512K,uid=1001,gid=1001
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
server {
2-
3-
listen 80;
4-
5-
location / {
6-
root /usr/share/nginx/html;
7-
index index.html index.htm;
8-
try_files $uri $uri/ /index.html;
9-
}
10-
11-
error_page 500 502 503 504 /50x.html;
12-
13-
location = /50x.html {
14-
root /usr/share/nginx/html;
15-
}
16-
17-
}
1+
server {
2+
3+
listen 80;
4+
5+
location / {
6+
root /usr/share/nginx/html;
7+
index index.html index.htm;
8+
try_files $uri $uri/ /index.html;
9+
}
10+
11+
error_page 500 502 503 504 /50x.html;
12+
13+
location = /50x.html {
14+
root /usr/share/nginx/html;
15+
}
16+
17+
}

index.html

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,13 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
3-
4-
<head>
5-
<meta charset="UTF-8" />
6-
<link rel="icon" href="/favicon.ico" />
7-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/svelte-material-ui@6.0.0-beta.16/bare.min.css" />
8-
<style type="text/css">
9-
html,
10-
body {
11-
padding: 0;
12-
margin: 0;
13-
}
14-
</style>
15-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
16-
<title>QR-Code Generator</title>
17-
</head>
18-
19-
<body>
20-
<div id="app"></div>
21-
<script type="module" src="/src/main.js"></script>
22-
</body>
23-
24-
</html>
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>QR-Code Generator</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>

jsconfig.json

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)