Skip to content

Instantly share code, notes, and snippets.

@shadowandy
Last active August 11, 2025 06:23
Show Gist options
  • Select an option

  • Save shadowandy/527f4dcc303885f192b27b3ecc167682 to your computer and use it in GitHub Desktop.

Select an option

Save shadowandy/527f4dcc303885f192b27b3ecc167682 to your computer and use it in GitHub Desktop.
Container for netplay relay server

Dockerfile and compose.yaml

netplay_folder
 |
 +-- Dockerfile
 |
 +-- compose.yaml

Dockerfile to bake the netplay-relay-server

Dockerfile

FROM python:alpine3.18
EXPOSE 55435
WORKDIR /app
RUN apk update && apk add git && apk add coreutils && \
    git clone https://github.com/libretro/netplay-tunnel-server.git && \
    mv /app/netplay-tunnel-server/* /app && \
    touch /app/tunnel.log && \
    ln -sf /proc/1/fd/1 /app/tunnel.log
    
ENTRYPOINT ["/usr/local/bin/python3","-OO"]
CMD ["/app/retroarch_tunnel_server.py"]

symlink-ed to redirect logs (written to tunnel.log) to STDOUT

Docker compose for the netplay relay server

compose.yaml

services:
  netplay-tunnel-server:
    build: .
    container_name: netplay-tunnel-server
    restart: unless-stopped
    ports:
      - "55435:55435"
    environment:
      - TZ=Asia/Singapore
    networks:
      - netplay-network
    
networks:
  netplay-network:
    name: "netplay_relay_network"
    ipam:
      driver: default
      config:
        - subnet: 172.18.231.0/24
          gateway: 172.18.231.1
          ip_range: 172.18.231.1/24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment