luluhacker commited on
Commit
65c69c9
·
verified ·
1 Parent(s): 5911483

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -32
Dockerfile CHANGED
@@ -1,38 +1,26 @@
1
- # Use the latest Debian image as the base
2
- FROM debian:latest
3
 
4
- # Set working directory
5
- WORKDIR /xmrig
 
 
 
 
6
 
7
- # Install dependencies
8
- RUN apt-get update && \
9
- apt-get install -y \
10
- git \
11
- build-essential \
12
- cmake \
13
- libuv1-dev \
14
- libssl-dev \
15
- libhwloc-dev
16
 
17
- # Clone the XMRig repository
18
- RUN git clone https://github.com/xmrig/xmrig.git
 
19
 
20
- # Change directory to the cloned repository
21
- WORKDIR /xmrig/xmrig
22
 
23
- # Build XMRig
24
- RUN mkdir build && cd build && \
25
- cmake .. && \
26
- make -j$(nproc)
27
 
28
- # Expose the ports for the mining pool
29
- EXPOSE 10300
30
- EXPOSE 10343
31
-
32
- # Set the default environment variables
33
- ENV WALLET_ADDRESS=46hkUW5558rbUX2wtg5cE2UwErru229jWLLcc6197HsYckLqNoRdJFKADW84YLaKjCR8xG8TJy93rT6wcn82aXREUTAhVJ9
34
- ENV POOL_URL=xmr-asia1.nanopool.org
35
- ENV STRATUM_PORT=10300
36
-
37
- # Command to run XMRig with the provided wallet address and pool details
38
- CMD ["./xmrig", "-o", "ssl://xmr-asia1.nanopool.org:10343", "-u", "${WALLET_ADDRESS}", "-p", "x", "-k", "--tls"]
 
1
+ # Use the official code-server image as the base
2
+ FROM codercom/code-server:latest
3
 
4
+ # Set environment variables
5
+ ENV PASSWORD=yugam786@
6
+ ENV CODE_SERVER_PORT=8080
7
+ ENV USERNAME=coder
8
+ ENV USER_UID=1000
9
+ ENV USER_GID=1000
10
 
11
+ # Install sudo and other necessary packages
12
+ USER root
13
+ RUN apt-get update && apt-get install -y sudo
 
 
 
 
 
 
14
 
15
+ # Create a user with sudo privileges
16
+ RUN adduser --disabled-password --gecos "" --uid $USER_UID --gid $USER_GID $USERNAME \
17
+ && echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd
18
 
19
+ # Switch back to the non-root user
20
+ USER $USERNAME
21
 
22
+ # Expose the port where code-server will run
23
+ EXPOSE ${CODE_SERVER_PORT}
 
 
24
 
25
+ # Start code-server with the desired settings
26
+ CMD ["code-server", "--bind-addr", "0.0.0.0:8080", "--auth", "password"]