hansaka1 commited on
Commit
d1cbd0a
·
verified ·
1 Parent(s): 85b8837

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -9
Dockerfile CHANGED
@@ -1,22 +1,25 @@
1
- FROM node:lts-alpine
2
 
3
- # Install postgres binaries, bash, and curl
4
  RUN apk add --no-cache postgresql postgresql-contrib bash curl
5
 
6
  # Download and install the lightweight Bore TCP tunnel agent
7
  RUN curl -L https://github.com/ekzhang/bore/releases/download/v0.5.1/bore-v0.5.1-x86_64-unknown-linux-musl.tar.gz | tar -xz -C /usr/local/bin
8
 
9
- # Switch to the default non-root user
10
- USER node
11
- ENV HOME=/home/node
 
12
  WORKDIR $HOME/app
 
 
13
  ENV PGDATA=$HOME/app/database_bucket
14
 
 
15
  EXPOSE 7860
16
 
17
- COPY --chown=node:node package*.json ./
18
- RUN npm install
19
- COPY --chown=node:node . .
20
-
21
  RUN chmod +x start.sh
 
22
  CMD ["./start.sh"]
 
1
+ FROM alpine:latest
2
 
3
+ # Install postgres database engine, bash, and curl
4
  RUN apk add --no-cache postgresql postgresql-contrib bash curl
5
 
6
  # Download and install the lightweight Bore TCP tunnel agent
7
  RUN curl -L https://github.com/ekzhang/bore/releases/download/v0.5.1/bore-v0.5.1-x86_64-unknown-linux-musl.tar.gz | tar -xz -C /usr/local/bin
8
 
9
+ # Set up the unprivileged user account (UID 1000) required by Hugging Face
10
+ RUN adduser -D -u 1000 hfuser
11
+ USER hfuser
12
+ ENV HOME=/home/hfuser
13
  WORKDIR $HOME/app
14
+
15
+ # Point database storage directly into your mounted persistent bucket
16
  ENV PGDATA=$HOME/app/database_bucket
17
 
18
+ # Expose the mandatory Hugging Face web traffic routing port
19
  EXPOSE 7860
20
 
21
+ # Copy only the startup controller script
22
+ COPY --chown=hfuser:hfuser start.sh .
 
 
23
  RUN chmod +x start.sh
24
+
25
  CMD ["./start.sh"]