alpine/base/Dockerfile

44 lines
1.2 KiB
Text
Raw Normal View History

2024-07-18 21:34:48 +00:00
# syntax = docker/dockerfile:1.2
FROM alpine:edge
USER root
# Build ARG for additional pacman packages to install (eg, openssh)
ARG addpkg
# 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 \
2024-07-18 22:02:54 +00:00
&& printf '%s\n' 'permit nopass user as root cmd /usr/sbin/nginx' >/etc/doas.conf \
2024-07-18 21:34:48 +00:00
&& 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 \
2024-07-18 21:54:21 +00:00
&& mkdir -p /app/nginx /app/logs \
2024-07-18 21:34:48 +00:00
&& chown -R user /app /usr/share/novnc/
# Default environment
USER 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"]