mirror of
https://github.com/JuLi0n21/pwa-player.git
synced 2026-04-19 15:30:05 +00:00
added docker files for deployment
This commit is contained in:
20
frontend/Dockerfile
Normal file
20
frontend/Dockerfile
Normal 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
12821
frontend/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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));
|
||||||
|
|||||||
@@ -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)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
4106
frontend/yarn.lock
4106
frontend/yarn.lock
File diff suppressed because it is too large
Load Diff
20
proxy/Dockerfile
Normal file
20
proxy/Dockerfile
Normal 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"]
|
||||||
Reference in New Issue
Block a user