Add Dockerfile and workflow for static hosting image.
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
node_modules
|
||||
database.sqlite
|
||||
dist
|
||||
.idea
|
||||
.output
|
||||
.nuxt
|
||||
.env
|
||||
36
.github/workflows/docker-image-static.yml
vendored
Normal file
36
.github/workflows/docker-image-static.yml
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
name: Docker Image CI - static
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
-
|
||||
name: Login to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: static.Dockerfile
|
||||
push: true
|
||||
tags: wongsaang/chatgpt-ui-client:latest-static,wongsaang/chatgpt-ui-client:${{ github.ref_name }}-static
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -7,4 +7,3 @@ node_modules
|
||||
.env
|
||||
.idea
|
||||
dist
|
||||
database.sqlite
|
||||
|
||||
@@ -2,9 +2,9 @@ server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name localhost;
|
||||
root /app;
|
||||
|
||||
location / {
|
||||
root /app;
|
||||
index index.html;
|
||||
|
||||
try_files $uri $uri/ /index.html;
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||
const appName = process.env.NUXT_PUBLIC_APP_NAME ?? 'ChatGPT UI'
|
||||
|
||||
export default defineNuxtConfig({
|
||||
debug: process.env.NODE_ENV !== 'production',
|
||||
ssr: true,
|
||||
ssr: process.env.SSR !== 'false',
|
||||
app: {
|
||||
head: {
|
||||
title: appName,
|
||||
|
||||
22
static.Dockerfile
Normal file
22
static.Dockerfile
Normal file
@@ -0,0 +1,22 @@
|
||||
FROM node:18-alpine3.16 as builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json yarn.lock ./
|
||||
|
||||
RUN yarn install
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN rm -r server && SSR=false yarn generate
|
||||
|
||||
|
||||
FROM nginx:1.22-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /app/.output/public .
|
||||
|
||||
COPY nginx.conf /etc/nginx/templates/default.conf.template
|
||||
|
||||
EXPOSE 80
|
||||
Reference in New Issue
Block a user