alpine/base/Dockerfile
2025-01-27 01:39:13 +00:00

50 lines
No EOL
1.3 KiB
Docker

# syntax = docker/dockerfile:1
FROM alpine:edge
USER root
# Exempt from image pruning
LABEL prune="do_not_delete"
# Build ARG for additional packages to install (eg, openssh)
ARG addpkg
# Build ARG: use "root" for debugging
ARG debug
# Copy app folder
COPY app /app
# Install noVNC
RUN printf '%s\n' 'https://dl-cdn.alpinelinux.org/alpine/edge/main/' \
'https://dl-cdn.alpinelinux.org/alpine/edge/community/' \
'https://dl-cdn.alpinelinux.org/alpine/edge/testing/' >/etc/apk/repositories \
&& apk update \
&& apk upgrade \
&& apk add --no-cache ${addpkg} \
doas \
bash bash-completion \
novnc websockify \
nginx \
&& adduser -s /bin/bash -D user \
&& printf '%s\n' 'permit nopass user as root cmd /usr/sbin/nginx' >/etc/doas.conf \
&& passwd -l root >/dev/null 2>&1 \
&& sed '/^http {/a\ \
include /app/nginx/\*.conf;\n\ \
types_hash_max_size 4096;\n\ \
server_names_hash_bucket_size 128;\n' -i /etc/nginx/nginx.conf \
&& mkdir -p /app/nginx /app/logs \
&& chown -R user /app /usr/share/novnc/
# Default environment
USER ${debug:-user}
WORKDIR /home/user
ENV HOME=/home/user
ENV DISPLAY=:0
ENV SHELL=/bin/bash
ENV PS1="[\u@\h \W \$?]\$ "
# Expose nginx port for VNC webui
EXPOSE 6900
# Docker entrypoint
ENTRYPOINT ["/app/entrypoint"]