mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Dockerize websocket server
This commit is contained in:
parent
61ee5e53fb
commit
344941057d
@ -118,6 +118,21 @@ services:
|
|||||||
env_file:
|
env_file:
|
||||||
- ./.env
|
- ./.env
|
||||||
|
|
||||||
|
websockets:
|
||||||
|
build:
|
||||||
|
context: ./websockets
|
||||||
|
dockerfile: Dockerfile.dev
|
||||||
|
volumes:
|
||||||
|
- ./websockets:/app
|
||||||
|
restart: on-failure
|
||||||
|
depends_on:
|
||||||
|
- rabbitmq
|
||||||
|
environment:
|
||||||
|
- RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER}
|
||||||
|
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS}
|
||||||
|
ports:
|
||||||
|
- 7777:7777
|
||||||
|
|
||||||
transcoder:
|
transcoder:
|
||||||
<<: *transcoder-base
|
<<: *transcoder-base
|
||||||
profiles: ['', 'cpu']
|
profiles: ['', 'cpu']
|
||||||
|
@ -36,6 +36,7 @@ in
|
|||||||
postgresql_15
|
postgresql_15
|
||||||
pgformatter
|
pgformatter
|
||||||
biome
|
biome
|
||||||
|
websocat
|
||||||
];
|
];
|
||||||
|
|
||||||
DOTNET_ROOT = "${dotnet}";
|
DOTNET_ROOT = "${dotnet}";
|
||||||
|
13
websockets/Dockerfile
Normal file
13
websockets/Dockerfile
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
FROM golang:1.21-alpine as build
|
||||||
|
WORKDIR /app
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download
|
||||||
|
COPY . .
|
||||||
|
RUN go build -o ./websockets
|
||||||
|
|
||||||
|
FROM alpine
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=build /app/websockets /app/websockets
|
||||||
|
|
||||||
|
EXPOSE 7777
|
||||||
|
CMD ./websockets
|
6
websockets/Dockerfile.dev
Normal file
6
websockets/Dockerfile.dev
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
FROM golang:1.21-alpine
|
||||||
|
RUN go install github.com/bokwoon95/wgo@latest
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
EXPOSE 7777
|
||||||
|
CMD wgo run .
|
@ -38,6 +38,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
log.Println("Listening on :7777")
|
||||||
err := http.ListenAndServe(":7777", nil)
|
err := http.ListenAndServe(":7777", nil)
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user