init
This commit is contained in:
commit
b227b49519
30
.editorconfig
Normal file
30
.editorconfig
Normal file
@ -0,0 +1,30 @@
|
||||
# EditorConfig is awesome: https://EditorConfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[{Makefile,go.mod,go.sum,*.go,*.templ,.gitmodules}]
|
||||
charset = utf-8
|
||||
indent_style = tab
|
||||
tab_width = 4
|
||||
indent_size = 4
|
||||
|
||||
[*.md]
|
||||
indent_size = 4
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
eclint_indent_style = unset
|
||||
|
||||
[Dockerfile]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[{*.js,*.ts}]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
tab_width = 4
|
||||
indent_size = 4
|
||||
|
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
.DS_Store
|
||||
gametube
|
12
docker-compose.yaml
Normal file
12
docker-compose.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
---
|
||||
services:
|
||||
server:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./docker/Dockerfile
|
||||
stdin_open: true
|
||||
tty: true
|
||||
environment:
|
||||
- DISPLAY=:99
|
||||
- PULSE_SERVER=unix:/tmp/pulse/native
|
||||
command: bash
|
32
docker/Dockerfile
Normal file
32
docker/Dockerfile
Normal file
@ -0,0 +1,32 @@
|
||||
FROM golang:1 AS build
|
||||
WORKDIR /server
|
||||
COPY ./server/ /server
|
||||
RUN go build -o gametube ./cmd/gametube/
|
||||
|
||||
FROM ubuntu:noble
|
||||
ENV DEBIAN_FRONTEND=noninteractive \
|
||||
DISPLAY=:99 \
|
||||
PULSE_SERVER=unix:/tmp/pulse/native
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
xvfb \
|
||||
openbox \
|
||||
pulseaudio \
|
||||
ffmpeg \
|
||||
dbus-x11 \
|
||||
x11-utils \
|
||||
wget \
|
||||
ca-certificates \
|
||||
x11-xkb-utils xkb-data \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
RUN mkdir -p /etc/xdg/openbox && \
|
||||
echo "<openbox_menu>\n</openbox_menu>" > /etc/xdg/openbox/menu.xml
|
||||
RUN mkdir -p /tmp/.X11-unix && chmod 1777 /tmp/.X11-unix
|
||||
RUN useradd -m -s /bin/bash gametube
|
||||
RUN mkdir -p /etc/pulse /var/run/pulse /tmp/pulse /run/user/1000 && \
|
||||
chown -R gametube:gametube /etc/pulse /var/run/pulse /tmp/pulse /run/user/1000
|
||||
COPY ./docker/pulse-client.conf /etc/pulse/client.conf
|
||||
COPY --from=build /server/gametube /home/gametube/bin/gametube
|
||||
RUN chmod 777 /home/gametube/bin/gametube
|
||||
USER gametube
|
||||
WORKDIR /home/gametube
|
||||
ENTRYPOINT ["/home/gametube/bin/gametube"]
|
2
docker/pulse-client.conf
Normal file
2
docker/pulse-client.conf
Normal file
@ -0,0 +1,2 @@
|
||||
default-server = unix:/tmp/pulse/native
|
||||
autospawn = no
|
3
server/go.mod
Normal file
3
server/go.mod
Normal file
@ -0,0 +1,3 @@
|
||||
module gametube
|
||||
|
||||
go 1.23.3
|
Loading…
x
Reference in New Issue
Block a user