-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
95 lines (73 loc) · 2.69 KB
/
Dockerfile
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
87
88
89
90
91
92
93
94
95
# Use an official Ubuntu runtime as a parent image
FROM ubuntu:23.10
# Set the timezone
RUN ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime
# Install any needed packages specified in requirements.txt
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata && apt-get install -y \
gnome-screenshot \
xvfb \
x11vnc \
fluxbox \
python3 \
python3-pip \
curl \
scrot \
python3-tk \
python3-dev \
git \
xz-utils
# Create /nix directory and change ownership
RUN mkdir -m 0755 /nix && chown root:root /nix
# Create nixbld group and users for Nix's build operations
RUN groupadd -r nixbld && \
for i in $(seq 1 10); do \
useradd -c "Nix build user $i" -d /var/empty -g nixbld -G nixbld -M -N -r -s "$(which nologin)" nixbld$i; \
done
# Install Nix 2.19.1 in single-user mode
#RUN curl -L https://nixos.org/nix/install | sh
RUN curl -L https://releases.nixos.org/nix/nix-2.19.1/install | sh
# Set up environment for Nix
ENV PATH=/root/.nix-profile/bin:$PATH
# Perform a shallow clone of the Nixpkgs repository at a specific commit
# Replace 'your_commit_hash' with the actual commit hash
RUN git clone --depth 1 --branch master https://github.com/NixOS/nixpkgs.git && \
cd nixpkgs && \
git fetch --depth 1 origin 33576fdfce2d11204067d6cfa99a2f990ef2169a && \
git checkout FETCH_HEAD
# Install packages using the specific version of Nixpkgs
# Example: installing Chromium
RUN nix-env -f /nixpkgs -iA chromium
# Set the working directory in the container to /app
WORKDIR /app
# Install Poetry
RUN curl -sSL https://install.python-poetry.org | python3 -
COPY pyproject.toml .
COPY poetry.lock .
WORKDIR /app/modules
WORKDIR /app
COPY modules/__init__.py modules/
RUN ~/.local/bin/poetry install
#COPY fluxbox/init /root/.fluxbox/init
#COPY fluxbox/menu /root/.fluxbox/menu
#COPY fluxbox/keys /root/.fluxbox/keys
#COPY fluxbox/startup /root/.fluxbox/startup
#COPY fluxbox/apps /root/.fluxbox/apps
#COPY fluxbox/slitlist /root/.fluxbox/slitlist
#COPY fluxbox/styles/Default /root/.fluxbox/styles/Default
#COPY fluxvox/overlay /root/.fluxbox/overlay
# Set environment v ariable
ENV DISPLAY=:1
# Make port 5900 available to the world outside this container
#EXPOSE 5900
# Run x11vnc when the container launches
#CMD Xvfb :1 -screen 0 1024x768x16 & x11vnc -display :1 -forever
#RUN apt-get update && apt-get install -y dbus-x11 x11-apps
#RUN dbus-uuidgen > /var/lib/dbus/machine-id
# Copy the entrypoint script into the container
COPY entrypoint.sh /entrypoint.sh
# RUN entrypoint script
RUN chmod +x /entrypoint.sh
# Set the entrypoint script to be executed
ENTRYPOINT ["/entrypoint.sh"]
# Default command to execute
CMD ["/bin/bash"]