Compare commits

..

2 commits

Author SHA1 Message Date
acfec04173 Add Caddy setup for serving the ui 2023-04-30 03:02:46 +02:00
86de126b41 Fix vite build
Removes remaining pina references from vuejs setup.
2023-04-30 01:58:20 +02:00
5 changed files with 70 additions and 3 deletions

12
ui/.containerignore Normal file
View file

@ -0,0 +1,12 @@
*
!Caddyfile
!package*.json
!postcss.config.js
!tailwind.config.js
!env.d..ts
!vite.config.ts
!tsconfig.json
!tsconfig.node.json
!index.html
!public/
!src/

11
ui/Caddyfile Normal file
View file

@ -0,0 +1,11 @@
{$SITE_ADDRESS} {
basicauth * {
{$AUTH_PASSWORD} {$AUTH_PASSWORD}
}
encode zstd gzip
root * /app
try_files {path} /index.html
file_server
}

16
ui/Containerfile Normal file
View file

@ -0,0 +1,16 @@
FROM docker.io/node:18-slim AS build
WORKDIR /app
COPY ./package* .
RUN npm ci
COPY . .
RUN npm run build-only
FROM docker.io/caddy:2-alpine
WORKDIR /app
COPY ./Caddyfile /
COPY --from=build /app/dist /app
EXPOSE 80
CMD ["caddy", "run", "--config", "/Caddyfile"]

31
ui/build.sh Executable file
View file

@ -0,0 +1,31 @@
#!/usr/bin/env bash
REPO="git.hhhammer.de/hamburghammer/dchat-ui"
AUTHORS="Augusto Dwenger J. <dwenger@posteo.de>"
URL="https://${REPO}"
VENDOR="hamburghammer"
TITLE="dchat-ui"
DESCRIPTION="The Web-UI for dchat a Discord bot to chat with ChatGPT from OpenAI"
CREATED=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
REVISION=$(git rev-parse HEAD)
IMAGE_LATEST="${REPO}:latest"
# shellcheck disable=SC2086
podman build \
$DOCKER_BUILD_ARGS \
-t $IMAGE_LATEST \
--label "org.opencontainers.image.revision=${REVISION}" \
--label "org.opencontainers.image.version=${TAG}" \
--label "org.opencontainers.image.authors=${AUTHORS}" \
--label "org.opencontainers.image.created=${CREATED}" \
--label "org.opencontainers.image.source=${URL}" \
--label "org.opencontainers.image.vendor=${VENDOR}" \
--label "org.opencontainers.image.title=${TITLE}" \
--label "org.opencontainers.image.description=${DESCRIPTION}" \
. || exit $?
if [ "$PUSH_LATEST" == "1" ]; then
podman push "${IMAGE_LATEST}"
fi

View file

@ -1,14 +1,11 @@
import { createApp } from 'vue' import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from '@/App.vue' import App from '@/App.vue'
import router from './router' import router from './router'
import './assets/main.css' import './assets/main.css'
const pinia = createPinia()
const app = createApp(App) const app = createApp(App)
app.use(pinia)
app.use(router) app.use(router)
app.mount('#app') app.mount('#app')