added docker files for deployment

This commit is contained in:
2024-09-22 09:01:24 +02:00
parent acaedfe8c7
commit b2a49ca9f7
9 changed files with 19640 additions and 4362 deletions

20
frontend/Dockerfile Normal file
View File

@@ -0,0 +1,20 @@
FROM node:18 AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install
# Copy the rest of the source code
COPY . .
RUN npm run build-only
FROM nginx:alpine
COPY --from=builder /app/dist /usr/share/nginx/html
EXPOSE 5001
CMD ["nginx", "-g", "daemon off;"]

12821
frontend/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -20,7 +20,7 @@ export const useAudioStore = defineStore('audioStore', () => {
const repeat = ref(false); const repeat = ref(false);
const activeCollection = ref<Song[]>([]); const activeCollection = ref<Song[]>([]);
const currentSong = ref<Song>(null); const currentSong = ref<Song | null>(null);
function saveSongToLocalStorage(song: Song) { function saveSongToLocalStorage(song: Song) {
localStorage.setItem('lastPlayedSong', JSON.stringify(song)); localStorage.setItem('lastPlayedSong', JSON.stringify(song));

View File

@@ -7,9 +7,9 @@ export const useUserStore = defineStore('userStore', () => {
const baseUrl = ref('https://service.illegalesachen.download/') const baseUrl = ref('https://service.illegalesachen.download/')
const proxyUrl = ref('https://proxy.illegalesachen.download/') const proxyUrl = ref('https://proxy.illegalesachen.download/')
const User = ref<Me>(null) const User = ref<Me | null>(null)
function saveUser(user: Me) { function saveUser(user: Me | null) {
localStorage.setItem('activeUser', JSON.stringify(user)); localStorage.setItem('activeUser', JSON.stringify(user));
} }
@@ -18,7 +18,7 @@ export const useUserStore = defineStore('userStore', () => {
return user ? JSON.parse(user) : null; return user ? JSON.parse(user) : null;
} }
function setUser(user: Me) { function setUser(user: Me | null) {
User.value = user; User.value = user;
saveUser(user) saveUser(user)
} }

View File

@@ -15,8 +15,7 @@ const borderColor = ref('');
const loginStatus = ref('Login'); const loginStatus = ref('Login');
function update() { function update() {
var input = document.getElementById("url-input") as HTMLAudioElement; var input = document.getElementById("url-input") as HTMLInputElement;
console.log(input.value)
userStore.baseUrl = input.value; userStore.baseUrl = input.value;
} }

File diff suppressed because it is too large Load Diff

20
proxy/Dockerfile Normal file
View File

@@ -0,0 +1,20 @@
FROM golang:1.23 AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o main .
FROM gcr.io/distroless/base-debian11
WORKDIR /app
COPY --from=builder /app/main .
EXPOSE 80
CMD ["./main"]