Create Dockerfile
Browse files- Dockerfile +60 -0
Dockerfile
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use Ubuntu as the base image
|
| 2 |
+
FROM ubuntu:latest
|
| 3 |
+
|
| 4 |
+
# Set environment variables for non-interactive installation
|
| 5 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 6 |
+
|
| 7 |
+
# Install necessary packages
|
| 8 |
+
RUN apt-get update && \
|
| 9 |
+
apt-get install -y wget unzip tar sudo curl build-essential && \
|
| 10 |
+
apt-get clean
|
| 11 |
+
|
| 12 |
+
# Install Node.js and npm (version 18)
|
| 13 |
+
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - && \
|
| 14 |
+
apt-get install -y nodejs
|
| 15 |
+
|
| 16 |
+
# Update npm to the latest version
|
| 17 |
+
RUN npm install -g npm@latest
|
| 18 |
+
|
| 19 |
+
# Install gritty globally
|
| 20 |
+
RUN npm install -g gritty@8.1.2
|
| 21 |
+
|
| 22 |
+
# Set environment variables for the user
|
| 23 |
+
ENV HOME=/home/user \
|
| 24 |
+
PATH=/home/user/.local/bin:$PATH
|
| 25 |
+
|
| 26 |
+
# Create and set the working directory
|
| 27 |
+
WORKDIR $HOME/app
|
| 28 |
+
|
| 29 |
+
# Download and extract the necessary files
|
| 30 |
+
RUN wget -O akuh.zip https://media.githubusercontent.com/media/akuhnet/wqemu/master/akuh.zip && \
|
| 31 |
+
unzip akuh.zip && \
|
| 32 |
+
unzip root.zip && \
|
| 33 |
+
rm -rf akuh.zip root.zip && \
|
| 34 |
+
chmod +x ./dist/proot
|
| 35 |
+
|
| 36 |
+
# Download and extract a minimal root filesystem for proot
|
| 37 |
+
RUN wget http://cdimage.ubuntu.com/ubuntu-base/releases/20.04/release/ubuntu-base-20.04.4-base-amd64.tar.gz && \
|
| 38 |
+
mkdir -p ./rootfs && \
|
| 39 |
+
tar -xzf ubuntu-base-20.04.4-base-amd64.tar.gz -C ./rootfs && \
|
| 40 |
+
rm ubuntu-base-20.04.4-base-amd64.tar.gz
|
| 41 |
+
|
| 42 |
+
# Change ownership of .npm directory to user
|
| 43 |
+
RUN mkdir -p /home/user/.npm && \
|
| 44 |
+
chown -R 1000:1000 /home/user/.npm
|
| 45 |
+
|
| 46 |
+
# Set up the proot environment and install additional packages
|
| 47 |
+
RUN ./dist/proot -S ./rootfs /bin/bash -c "\
|
| 48 |
+
apt-get update && \
|
| 49 |
+
apt-get install -y sudo apt-utils && \
|
| 50 |
+
sudo apt update && \
|
| 51 |
+
sudo apt upgrade -y && \
|
| 52 |
+
sudo apt update --fix-missing && \
|
| 53 |
+
sudo apt install apt-utils -y && \
|
| 54 |
+
echo '-: Package and Sudo setup complete. :-'"
|
| 55 |
+
|
| 56 |
+
# Expose port 8000 (if needed for your application)
|
| 57 |
+
EXPOSE 7860
|
| 58 |
+
|
| 59 |
+
# Set the entrypoint to open a normal terminal for the web UI
|
| 60 |
+
CMD ["gritty", "--port", "7860", "--command", "bash", "--auto-restart"]
|