-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
82 lines (66 loc) · 2.32 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
# dockerfile amd46
FROM rust:latest
## Copy project files
WORKDIR /home
COPY ./project ./project
COPY ./public ./public
COPY ./frontend ./frontend
COPY ./backend ./backend
COPY ./build.sbt ./build.sbt
COPY ./index.html ./index.html
COPY ./package-lock.json ./package-lock.json
COPY ./package.json ./package.json
COPY ./vite.config.ts ./vite.config.ts
# Scala and sbt
RUN wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | apt-key add -
RUN echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list
RUN apt-get update
RUN apt-get install -y temurin-11-jdk
RUN curl -fL https://github.com/coursier/coursier/releases/latest/download/cs-x86_64-pc-linux.gz | gzip -d > cs && chmod +x cs && echo "Y" | ./cs setup
RUN ./cs install sbt --install-dir /
# Tauri dependencies
RUN apt-get update && apt-get install -y \
libwebkit2gtk-4.0-dev \
build-essential \
curl \
wget \
file \
libssl-dev \
libgtk-4-dev \
libayatana-appindicator3-dev\
librsvg2-dev \
javascriptcoregtk-4.1 \
webkit2gtk-4.1
# Nodejs and npm
RUN apt-get install -y nodejs
RUN apt-get install -y npm
RUN npm install
# Build Frontend (Optional to do here)
RUN /sbt buildFrontend
# Rust and tauri
RUN cargo install tauri-cli
RUN rustup target add x86_64-unknown-linux-gnu # add the target for the specific architecture
# Install X11 libraries and OpenSSH server
RUN apt-get update && apt-get install -y \
xauth \
x11-apps \
openssh-server
# Set up SSH and expose SSH port
RUN mkdir /var/run/sshd
EXPOSE 22
# Add helpful commands for terminal
RUN apt-get update && apt-get install -y \
vim \
nano \
sudo
# cargo is in /usr/local/cargo/bin but only way to get it to work is redownload
RUN echo '\nexport PATH=/usr/local/cargo/bin:$PATH\nalias sbt="sudo /sbt"' >> /root/.bashrc
#Remove root password
RUN passwd -d root
# Allow accessing root and using empty passwords with X11 localhost
RUN \
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/" /etc/ssh/sshd_config && \
sed -i "s/#PermitEmptyPasswords no/PermitEmptyPasswords yes/" /etc/ssh/sshd_config && \
sed -i "s/#X11UseLocalhost/X11UseLocalhost/" /etc/ssh/sshd_config
# Start the SSH server
CMD sh -c "/usr/sbin/sshd -D"