gudada commited on
Commit
bdb558b
·
verified ·
1 Parent(s): 94a3ced

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -30
Dockerfile CHANGED
@@ -1,44 +1,22 @@
1
- # Set up a new user named "user" with user ID 1000
2
- RUN useradd -m -u 1000 app
3
 
4
- # Switch to the "user" user
5
- USER app
6
 
7
- # Set home to the user's home directory
8
- ENV HOME=/home/app \
9
- PATH=/home/app/.local/bin:$PATH
10
 
11
- # Set the working directory to the user's home directory
12
  WORKDIR $HOME/app
13
 
14
- # Try and run pip command after setting the user with `USER user` to avoid permission issues with Python
15
- RUN pip install --no-cache-dir --upgrade pip
16
-
17
- # Copy the current directory contents into the container at $HOME/app setting the owner to the user
18
- COPY --chown=app . $HOME/app
19
-
20
- # Download a checkpoint
21
- RUN mkdir content
22
- #ADD --chown=user https://<SOME_ASSET_URL> content/<SOME_ASSET_NAME>
23
-
24
-
25
- FROM node:lts AS BUILD_IMAGE
26
-
27
- #WORKDIR /app
28
-
29
- #COPY . /app
30
 
31
  RUN yarn install --registry https://registry.npmmirror.com/ && yarn run build
32
 
33
  FROM node:lts-alpine
34
 
35
- COPY --from=BUILD_IMAGE /app/configs /app/configs
36
- COPY --from=BUILD_IMAGE /app/package.json /app/package.json
37
- COPY --from=BUILD_IMAGE /app/dist /app/dist
38
- COPY --from=BUILD_IMAGE /app/public /app/public
39
- COPY --from=BUILD_IMAGE /app/node_modules /app/node_modules
40
 
41
- WORKDIR /app
42
 
43
  EXPOSE 8000
44
 
 
1
+ FROM node:lts AS BUILD_IMAGE
 
2
 
 
 
3
 
 
 
 
4
 
 
5
  WORKDIR $HOME/app
6
 
7
+ COPY . $HOME/app
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
  RUN yarn install --registry https://registry.npmmirror.com/ && yarn run build
10
 
11
  FROM node:lts-alpine
12
 
13
+ COPY --from=BUILD_IMAGE /app/configs $HOME/app/configs
14
+ COPY --from=BUILD_IMAGE /app/package.json $HOME/app/package.json
15
+ COPY --from=BUILD_IMAGE /app/dist $HOME/app/dist
16
+ COPY --from=BUILD_IMAGE /app/public $HOME/app/public
17
+ COPY --from=BUILD_IMAGE /app/node_modules $HOME/app/node_modules
18
 
19
+ WORKDIR $HOME/app
20
 
21
  EXPOSE 8000
22