-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdockerfile
More file actions
86 lines (75 loc) · 3.8 KB
/
dockerfile
File metadata and controls
86 lines (75 loc) · 3.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# -----------------------------------------------------------------------------
# BackupOnePass – headless 1Password backup container (Ubuntu 22.04 Jammy)
# -----------------------------------------------------------------------------
FROM phusion/baseimage:jammy-1.0.4
LABEL maintainer="NorkzYT <richard@pcscorp.dev>"
# -----------------------------------------------------------------------------
# Global environment
# -----------------------------------------------------------------------------
ENV DEBIAN_FRONTEND=noninteractive \
APP_USER=onepassword \
APP_GROUP=onepassword
# -----------------------------------------------------------------------------
# Create the application user once, at build‑time
# -----------------------------------------------------------------------------
RUN groupadd -g 1000 "${APP_GROUP}" \
&& useradd -m -u 1000 -g "${APP_GROUP}" -s /bin/bash "${APP_USER}" \
&& passwd -d "${APP_USER}"
# -----------------------------------------------------------------------------
# System packages
# -----------------------------------------------------------------------------
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
RUN set -eux; \
# retry apt-get update up to 3 times in case of mirror sync errors
for i in 1 2 3; do \
apt-get update && break || echo "apt‐get update failed, retrying…" && sleep 5; \
done; \
apt-get install -y --no-install-recommends \
jq sudo gedit locales curl gnupg2 lsb-release \
xdotool oathtool xvfb x11-xserver-utils \
python3-opencv scrot python3-pip dbus-x11 \
cron x11vnc novnc websockify \
libgbm1 lsof openbox \
python3-pyxdg libasound2 \
&& rm -rf /var/lib/apt/lists/*
# -----------------------------------------------------------------------------
# Python packages
# -----------------------------------------------------------------------------
COPY docker/config/requirements.txt /tmp/requirements.txt
RUN pip3 install --no-cache-dir --upgrade pip \
&& pip3 install --no-cache-dir -r /tmp/requirements.txt
# -----------------------------------------------------------------------------
# Copy project tree and preserve script permissions
# -----------------------------------------------------------------------------
COPY docker/ /backuponepass/
RUN \
find /backuponepass -type f -name "*.sh" -exec chmod +x {} \; && \
find /backuponepass -type f -name "*.py" -exec chmod +x {} \; && \
ln -s /backuponepass/scripts/py/cli.py /usr/local/bin/backuponepass-cli && \
chmod +x /usr/local/bin/backuponepass-cli
# Fix Openbox “missing menu”
RUN mkdir -p /var/lib/openbox && \
printf '%s\n' \
'<?xml version="1.0" encoding="UTF-8"?>' \
'<!DOCTYPE openbox_menu SYSTEM "http://openbox.org/Openbox1Menu.dtd">' \
'<openbox_menu/>' \
> /var/lib/openbox/debian-menu.xml
# -----------------------------------------------------------------------------
# 1Password installation
# -----------------------------------------------------------------------------
RUN /backuponepass/config/install_1password.sh
ENV PATH="/opt/1Password:${PATH}"
# -----------------------------------------------------------------------------
# Prepare HOME
# -----------------------------------------------------------------------------
RUN mkdir -p /home/${APP_USER}/.config \
&& chown -R ${APP_USER}:${APP_GROUP} /home/${APP_USER}
# -----------------------------------------------------------------------------
# VNC / noVNC
# -----------------------------------------------------------------------------
EXPOSE 5900 6080
# -----------------------------------------------------------------------------
# Entrypoint (kept as root – switches user internally)
# -----------------------------------------------------------------------------
ENTRYPOINT ["/backuponepass/config/entrypoint.sh"]