FROM ubuntu:24.04

# Install tools
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
	build-essential chrpath cmake git \
	file wget zip \
	libpng-dev libxext-dev libgl-dev libboost-all-dev libmpg123-dev \
	libxi-dev libxrender-dev \
	libasound2-dev libpulse-dev \
	libfreetype-dev libsdl2-dev nodejs

# Set user
RUN useradd -u 1000 -U -o -d /home -M worker
RUN chown -R worker:worker /home /usr/local
USER worker
WORKDIR /home

# Install wgpu-native
RUN wget https://github.com/gfx-rs/wgpu-native/releases/download/v0.19.4.1/wgpu-linux-x86_64-release.zip
RUN mkdir -p wgpu-native
RUN unzip wgpu-*.zip -d wgpu-native
RUN rm wgpu-*.zip
RUN mkdir -p wgpu-native/install
RUN mv wgpu-native/libwgpu_native.a wgpu-native/install
