mirror of
https://git.maid.zone/stuff/soundcloak.git
synced 2025-12-10 13:49:39 +05:00
Add Docker
This commit is contained in:
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
LICENSE
|
||||||
|
README.md
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,4 +5,3 @@ package-lock.json
|
|||||||
fly.toml
|
fly.toml
|
||||||
*.fiber.gz
|
*.fiber.gz
|
||||||
soundcloak.json
|
soundcloak.json
|
||||||
Dockerfile
|
|
||||||
28
Dockerfile
Normal file
28
Dockerfile
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
ARG GO_VERSION=1.21.3
|
||||||
|
ARG NODE_VERSION=bookworm
|
||||||
|
|
||||||
|
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION} AS build
|
||||||
|
ARG TARGETOS
|
||||||
|
ARG TARGETARCH
|
||||||
|
|
||||||
|
WORKDIR /build
|
||||||
|
COPY . .
|
||||||
|
RUN go install github.com/a-h/templ/cmd/templ@latest && \
|
||||||
|
templ generate && \
|
||||||
|
CGO_ENABLED=0 GOARCH=${TARGETARCH} GOOS=${TARGETOS} go build -ldflags "-s -w -extldflags '-static'" -o ./app
|
||||||
|
|
||||||
|
FROM node:${NODE_VERSION} AS node
|
||||||
|
WORKDIR /hls.js
|
||||||
|
COPY --from=build /build/package.json ./
|
||||||
|
RUN npm i
|
||||||
|
|
||||||
|
FROM scratch
|
||||||
|
|
||||||
|
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||||
|
COPY --from=build /build/assets /assets
|
||||||
|
COPY --from=build /build/app /app
|
||||||
|
COPY --from=node /hls.js/node_modules /node_modules
|
||||||
|
|
||||||
|
EXPOSE 4664
|
||||||
|
|
||||||
|
ENTRYPOINT ["/app"]
|
||||||
13
compose.yaml
Normal file
13
compose.yaml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
services:
|
||||||
|
soundcloak:
|
||||||
|
container_name: soundcloak
|
||||||
|
restart: unless-stopped
|
||||||
|
build: .
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:4664:4664"
|
||||||
|
cap_drop:
|
||||||
|
- ALL
|
||||||
|
security_opt:
|
||||||
|
- no-new-privileges:true
|
||||||
|
volumes:
|
||||||
|
- ./soundcloak.json:/soundcloak.json
|
||||||
Reference in New Issue
Block a user