forked from lecepin/gen-brand-photo-pictrue
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from zhiweio/feture/update
- Loading branch information
Showing
18 changed files
with
305 additions
and
426 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.github/ | ||
.idea/ | ||
.vscode/ | ||
dist/ | ||
node_modules/ | ||
src-wasm/target/ | ||
.git/ | ||
*.md | ||
LICENSE | ||
stats.html | ||
vercel.json | ||
.dockerignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Docker Build and Push | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: The version to build | ||
|
||
push: | ||
tags: | ||
- '*.*' | ||
- '*.*.*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and Push Docker Image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
tags: ${{ secrets.DOCKER_USERNAME }}/picseal:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
FROM node:22 AS build | ||
|
||
RUN useradd -m picseal | ||
|
||
USER picseal | ||
|
||
ENV HOME=/home/picseal | ||
|
||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
|
||
ENV PATH="$HOME/.cargo/bin:$PATH" | ||
|
||
RUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh -s -- -y | ||
|
||
WORKDIR /app | ||
|
||
COPY public/ scripts/ src/ src-wasm/ eslint.config.js index.html package.json tsconfig.app.json tsconfig.json tsconfig.node.json vite.config.ts ./ | ||
|
||
RUN npm install | ||
|
||
RUN npm run build | ||
|
||
FROM nginx:alpine AS production | ||
|
||
COPY --from=build /app/dist /usr/share/nginx/html | ||
|
||
COPY ./nginx.conf /etc/nginx/conf.d/default.conf | ||
|
||
EXPOSE 80 | ||
|
||
CMD ["nginx", "-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
server { | ||
listen 80; | ||
server_name _;; | ||
|
||
root /usr/share/nginx/html; | ||
index index.html; | ||
|
||
location / { | ||
try_files $uri /index.html; | ||
} | ||
|
||
location ~* \.(?:ico|css|js|woff|woff2|ttf|otf|eot|svg|jpg|jpeg|png|gif|webp|avif|mp4|webm|ogv|ogg|mp3|m4a|wav|flac)$ { | ||
expires 6M; | ||
access_log off; | ||
add_header Cache-Control "public, max-age=15768000, immutable"; | ||
} | ||
|
||
error_page 404 /index.html; | ||
|
||
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; | ||
add_header X-Content-Type-Options "nosniff" always; | ||
add_header X-Frame-Options "DENY" always; | ||
add_header X-XSS-Protection "1; mode=block" always; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.