Mandri commited on
Commit
b3c342d
·
unverified ·
1 Parent(s): 51af754

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +58 -0
Dockerfile ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
+
5
+ # Install nginx
6
+ RUN apt-get update && \
7
+ apt-get install -y nginx && \
8
+ rm -rf /var/lib/apt/lists/*
9
+
10
+ # Buat direktori sementara agar tidak butuh root
11
+ RUN mkdir -p /tmp/nginx/logs /tmp/nginx/client-body /tmp/nginx/proxy \
12
+ /tmp/nginx/run /tmp/nginx/fastcgi /tmp/nginx/uwsgi /tmp/nginx/scgi
13
+
14
+ # Copy website
15
+ COPY app /app
16
+
17
+ # Konfigurasi nginx
18
+ RUN echo " \
19
+ error_log /tmp/nginx/logs/error.log; \
20
+ pid /tmp/nginx/run/nginx.pid; \
21
+ \
22
+ events { \
23
+ worker_connections 1024; \
24
+ } \
25
+ \
26
+ http { \
27
+ include /etc/nginx/mime.types; \
28
+ default_type application/octet-stream; \
29
+ sendfile on; \
30
+ keepalive_timeout 65; \
31
+ \
32
+ proxy_temp_path /tmp/nginx/proxy; \
33
+ client_body_temp_path /tmp/nginx/client-body; \
34
+ fastcgi_temp_path /tmp/nginx/fastcgi; \
35
+ uwsgi_temp_path /tmp/nginx/uwsgi; \
36
+ scgi_temp_path /tmp/nginx/scgi; \
37
+ \
38
+ server { \
39
+ listen 7860; \
40
+ root /app; \
41
+ index index.html; \
42
+ \
43
+ access_log /tmp/nginx/logs/access.log; \
44
+ \
45
+ location / { \
46
+ try_files \$uri \$uri/ =404; \
47
+ } \
48
+ } \
49
+ } \
50
+ " > /etc/nginx/nginx.conf
51
+
52
+ # Hugging Face pakai port 7860
53
+ EXPOSE 7860
54
+
55
+ # Jalankan non-root user
56
+ USER 1000
57
+
58
+ CMD ["nginx", "-g", "daemon off;"]