alpine/base/Dockerfile

50 lines
1.3 KiB
Text
Raw Permalink Normal View History

2024-07-18 22:49:51 +00:00
# syntax = docker/dockerfile:1
2024-07-18 21:34:48 +00:00
FROM alpine:edge
USER root
2025-01-27 01:39:13 +00:00
# Exempt from image pruning
LABEL prune="do_not_delete"
2024-07-19 01:22:49 +00:00
# Build ARG for additional packages to install (eg, openssh)
2024-07-18 21:34:48 +00:00
ARG addpkg
2024-07-19 01:22:49 +00:00
# Build ARG: use "root" for debugging
ARG debug
2024-07-18 21:34:48 +00:00
# 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
2024-07-19 01:22:49 +00:00
USER ${debug:-user}
2024-07-18 21:34:48 +00:00
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
2024-07-19 01:22:49 +00:00
ENTRYPOINT ["/app/entrypoint"]