victorgeek commited on
Commit
ee079cc
·
verified ·
1 Parent(s): 5a3f409

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -24
Dockerfile CHANGED
@@ -1,40 +1,34 @@
1
  # Use the official Rust image as a build stage
2
- FROM rust as builder
3
-
4
- # Set the working directory
5
- WORKDIR /usr/src/ferron
6
-
7
- # Copy the source code
8
- COPY . .
9
-
10
- # Build the actual application
11
- RUN cargo build --release
12
 
13
  # Use a Devuan base image for the final image
14
- FROM devuan/devuan
15
 
16
  # Copy the compiled binaries from the builder stage
17
- COPY --from=builder /usr/src/ferron/target/release/ferron /usr/sbin/ferron
18
- COPY --from=builder /usr/src/ferron/target/release/ferron-passwd /usr/sbin/ferron-passwd
19
 
20
- # Copy the web server configuration
21
- COPY ferron-docker.yaml /etc/ferron.yaml
 
22
 
23
  # Copy the web root contents
24
  RUN mkdir -p /var/www/ferron
25
- COPY wwwroot/* /var/www/ferron
26
 
27
  # Create a directory where Ferron logs are stored
28
  RUN mkdir -p /var/log/ferron
29
 
30
- # Create a "ferron" user and grant the permissions for the log directory and the webroot to that user
31
- RUN useradd -d /nonexistent -s /usr/sbin/nologin -r ferron && chown -hR ferron:ferron /var/www/ferron && chown -hR ferron:ferron /var/log/ferron
 
 
32
 
33
- # Expose the port 80 (used for HTTP)
34
- EXPOSE 80
 
35
 
36
- # Switch to "ferron" user
37
- USER ferron
38
 
39
- # Set the command to run the binary
40
- CMD ["/usr/sbin/ferron", "-c", "/etc/ferron.yaml"]
 
1
  # Use the official Rust image as a build stage
2
+ # ... (Build stage remains the same) ...
 
 
 
 
 
 
 
 
 
3
 
4
  # Use a Devuan base image for the final image
5
+ FROM devuan/devuan:latest
6
 
7
  # Copy the compiled binaries from the builder stage
8
+ # ... (Binary copy commands remain the same) ...
 
9
 
10
+ # <<< အရေးကြီး: Local မှာ 'ferron-docker.yaml' file ရှိပြီး အပေါ်က YAML content အမှန် ထည့်ထားကြောင်း သေချာပါစေ >>>
11
+ # Copy the web server configuration (Local filename တူရမည်)
12
+ COPY ferron-docker.yaml /etc/ferron.yaml # <<< ဒီ command မှန်ပါတယ်၊ local file content မှန်ဖို့ပဲလိုတယ်
13
 
14
  # Copy the web root contents
15
  RUN mkdir -p /var/www/ferron
16
+ COPY wwwroot/* /var/www/ferron/ # <<< Local မှာ wwwroot ရှိရမည်
17
 
18
  # Create a directory where Ferron logs are stored
19
  RUN mkdir -p /var/log/ferron
20
 
21
+ # Create a "ferron" user and grant the permissions
22
+ RUN useradd -d /nonexistent -s /usr/sbin/nologin -r ferron && \
23
+ chown -R ferron:ferron /var/www/ferron && \
24
+ chown -R ferron:ferron /var/log/ferron # <<< ဒီ command မှန်ပါတယ်
25
 
26
+ # --- ပြင်ဆင်ရန် ---
27
+ # Expose the port Hugging Face expects (8080)
28
+ EXPOSE 8080 # <<< 80 မဟုတ်တော့ပါ
29
 
30
+ # Switch to "ferron" user (AFTER ownership changes)
31
+ USER ferron # <<< ဒီ command မှန်ပါတယ်
32
 
33
+ # Set the command to run the binary using the config file
34
+ CMD ["/usr/sbin/ferron", "-c", "/etc/ferron.yaml"] # <<< ဒီ command မှန်ပါတယ်