Update Dockerfile
Browse files- Dockerfile +23 -10
Dockerfile
CHANGED
|
@@ -1,24 +1,37 @@
|
|
| 1 |
FROM ubuntu:22.04
|
| 2 |
|
| 3 |
-
# 1. Install
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
curl \
|
| 6 |
sudo \
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
&& rm -rf /var/lib/apt/lists/*
|
| 8 |
|
| 9 |
-
# 2.
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
RUN dpkg -i /tmp/opencode.deb || apt-get install -f -y
|
| 12 |
|
| 13 |
-
#
|
| 14 |
-
RUN
|
|
|
|
|
|
|
| 15 |
USER user
|
| 16 |
ENV HOME=/home/user \
|
| 17 |
-
PATH=/home/user/.local/bin:$PATH
|
| 18 |
|
| 19 |
-
# 4. Set the working directory
|
| 20 |
WORKDIR $HOME/app
|
| 21 |
|
| 22 |
-
#
|
| 23 |
-
#
|
| 24 |
-
CMD ["
|
|
|
|
| 1 |
FROM ubuntu:22.04
|
| 2 |
|
| 3 |
+
# 1. Install system dependencies (Desktop apps need these to even start)
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
curl \
|
| 6 |
sudo \
|
| 7 |
+
libgbm1 \
|
| 8 |
+
libasound2 \
|
| 9 |
+
# Standard Electron/IDE dependencies
|
| 10 |
+
libnss3 \
|
| 11 |
+
libxss1 \
|
| 12 |
+
libatk-bridge2.0-0 \
|
| 13 |
+
libgtk-3-0 \
|
| 14 |
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
|
| 16 |
+
# 2. Setup user
|
| 17 |
+
RUN useradd -m -u 1000 user
|
| 18 |
+
USER root
|
| 19 |
+
|
| 20 |
+
# 3. Copy and Install the .deb
|
| 21 |
+
# Replace 'your_file_name.deb' with the actual name of your file
|
| 22 |
+
COPY 1000068060.deb /tmp/opencode.deb
|
| 23 |
RUN dpkg -i /tmp/opencode.deb || apt-get install -f -y
|
| 24 |
|
| 25 |
+
# 4. Fix Permissions
|
| 26 |
+
RUN chown -R user:user /home/user
|
| 27 |
+
|
| 28 |
+
# 5. Switch to user
|
| 29 |
USER user
|
| 30 |
ENV HOME=/home/user \
|
| 31 |
+
PATH=/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
|
| 32 |
|
|
|
|
| 33 |
WORKDIR $HOME/app
|
| 34 |
|
| 35 |
+
# 6. THE FIX: We use a shell script to find the executable if 'opencode' isn't right
|
| 36 |
+
# Most .deb IDEs install to /usr/bin/ or /opt/OpenCode/
|
| 37 |
+
CMD ["sh", "-c", "opencode-desktop --host 0.0.0.0 --port 7860 || opencode --host 0.0.0.0 --port 7860 || /opt/OpenCode/opencode --host 0.0.0.0 --port 7860"]
|