|
|
|
|
|
FROM mcr.microsoft.com/dotnet/aspnet:8.0 |
|
|
|
|
|
RUN apt-get update \ |
|
|
&& apt-get install -y wget libarchive-tools \ |
|
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
|
|
|
RUN useradd -m -u 1000 appuser |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
|
|
|
ARG ZIP_URL="https://github.com/Myster-Tee/TinfoilWebServer/releases/download/v2.1.0/TinfoilWebServer_v2.1.0_Framework-Dependent-linux-x64.zip" |
|
|
RUN wget -O /tmp/tws.zip "$ZIP_URL" \ |
|
|
&& bsdtar -xf /tmp/tws.zip -C /app \ |
|
|
&& rm -f /tmp/tws.zip \ |
|
|
&& subdir="$(find /app -mindepth 1 -maxdepth 1 -type d -name 'TinfoilWebServer*linux-x64' | head -n1)" \ |
|
|
&& if [ -n "$subdir" ]; then cp -a "$subdir"/. /app/ && rm -rf "$subdir"; fi \ |
|
|
&& if [ -f /app/TinfoilWebServer ]; then chmod +x /app/TinfoilWebServer; fi |
|
|
|
|
|
|
|
|
COPY TinfoilWebServer.config.json /app/TinfoilWebServer.config.json |
|
|
COPY index.json /app/index.json |
|
|
|
|
|
|
|
|
COPY entrypoint.sh /app/entrypoint.sh |
|
|
RUN chmod +x /app/entrypoint.sh |
|
|
|
|
|
|
|
|
RUN chown -R appuser:appuser /app |
|
|
|
|
|
|
|
|
USER appuser |
|
|
ENV HOME=/home/appuser |
|
|
|
|
|
|
|
|
VOLUME ["/data"] |
|
|
EXPOSE 5000 |
|
|
|
|
|
CMD ["/app/entrypoint.sh"] |
|
|
|