now running as user

This commit is contained in:
norimicry 2020-04-07 04:40:06 +02:00
parent 39b2650c21
commit 0c9c9a4eb1
3 changed files with 10 additions and 11 deletions

View File

@ -3,16 +3,14 @@ version: '2.2'
services: services:
valley: valley:
build: docker build: docker
container_name: stardew
ports: ports:
- 5902:5900 - 5902:5900
- 24642:24642/udp - 24642:24642/udp
volumes: volumes:
- ./asound.conf:/etc/asound.conf
- ./config:/root/.config/i3/config - ./config:/root/.config/i3/config
- ./valley_saves:/root/.config/StardewValley/Saves/ - ./valley_saves:/home/nya/.config/StardewValley/Saves/
- ./configs/alwayson.json:/data/Stardew/Stardew\ Valley/Mods/Always\ On\ Server/config.json - ./configs/alwayson.json:/data/Stardew/Stardew Valley/Mods/Always On Server/config.json
- ./configs/unlimitedplayers.json:/data/Stardew/Stardew\ Valley/Mods/UnlimitedPlayers/config.json - ./configs/unlimitedplayers.json:/data/Stardew/Stardew Valley/Mods/UnlimitedPlayers/config.json
- ./configs/autoload.json:/data/Stardew/Stardew\ Valley/Mods/AutoLoadGame/config.json - ./configs/autoload.json:/data/Stardew/Stardew Valley/Mods/AutoLoadGame/config.json
devices:
- /dev/snd:/dev/snd

View File

@ -11,7 +11,7 @@ RUN mkdir -p /data/Stardew && \
rm /data/latest.tar.gz && \ rm /data/latest.tar.gz && \
wget https://github.com/Pathoschild/SMAPI/releases/download/3.4.1/SMAPI-3.4.1-installer.zip -qO /data/nexus.zip && \ wget https://github.com/Pathoschild/SMAPI/releases/download/3.4.1/SMAPI-3.4.1-installer.zip -qO /data/nexus.zip && \
unzip /data/nexus.zip -d /data/nexus/ && \ unzip /data/nexus.zip -d /data/nexus/ && \
/bin/bash -c "echo -e \"2\n/data/Stardew/Stardew\ Valley\n1\n\" | /usr/bin/mono /data/nexus/SMAPI\ 3.4.1\ installer/internal/unix-install.exe" /bin/bash -c "echo -e \"2\n/data/Stardew/Stardew\ Valley\n1\n\" | /usr/bin/mono /data/nexus/SMAPI\ 3.4.1\ installer/internal/unix-install.exe"
# Add Mods # Add Mods
COPY mods/alwayson.zip /data/alwayson.zip COPY mods/alwayson.zip /data/alwayson.zip
@ -22,7 +22,8 @@ RUN unzip /data/alwayson.zip -d /data/Stardew/Stardew\ Valley/Mods && \
unzip /data/unlimitedplayers.zip -d /data/Stardew/Stardew\ Valley/Mods && \ unzip /data/unlimitedplayers.zip -d /data/Stardew/Stardew\ Valley/Mods && \
unzip /data/autoloadgame.zip -d /data/Stardew/Stardew\ Valley/Mods && \ unzip /data/autoloadgame.zip -d /data/Stardew/Stardew\ Valley/Mods && \
rm /data/alwayson.zip /data/unlimitedplayers.zip /data/autoloadgame.zip rm /data/alwayson.zip /data/unlimitedplayers.zip /data/autoloadgame.zip
RUN chown -R 1010:1010 /data && chmod +x /data/Stardew/Stardew\ Valley/StardewValley && useradd -m -u 1010 nya
USER nya
COPY docker-entrypoint.sh /docker-entrypoint.sh COPY docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@ -1,11 +1,11 @@
#!/bin/bash #!/bin/bash
if [ -f /tmp/.X10-lock ]; then rm /tmp/.X10-lock; fi
Xvfb :10 -screen 0 1580x920x24 -ac & Xvfb :10 -screen 0 1580x920x24 -ac &
export DISPLAY=:10.0 export DISPLAY=:10.0
x11vnc -display :10 -rfbport 5900 -rfbportv6 -1 -no6 -noipv6 -httpportv6 -1 -forever -desktop StardewValley -cursor arrow -shared -passwd 23eris42 & x11vnc -display :10 -rfbport 5900 -rfbportv6 -1 -no6 -noipv6 -httpportv6 -1 -forever -desktop StardewValley -cursor arrow -shared -passwd 23eris42 &
sleep 5 sleep 5
i3 & i3 &
chmod +x /data/Stardew/Stardew\ Valley/StardewValley export XAUTHORITY=~/.Xauthority
TERM=xterm TERM=xterm
/data/Stardew/Stardew\ Valley/StardewValley /data/Stardew/Stardew\ Valley/StardewValley