@@ -17,12 +17,10 @@ ENV SERVER_TLS_KEY=${SERVER_TLS_KEY}
17
17
ENV SEGMENT_WRITE_KEY=${SEGMENT_WRITE_KEY}
18
18
19
19
# update apk repository and install build dependencies
20
- RUN apk update
21
- RUN apk add --no-cache --virtual .gyp \
20
+ RUN apk update && apk add --no-cache --virtual .gyp \
22
21
python3 \
23
22
make \
24
- g++ \
25
- net-tools
23
+ g++
26
24
27
25
# set workdir
28
26
WORKDIR /usr/src/app
@@ -41,7 +39,7 @@ RUN yarn --cwd redisinsight/api install
41
39
# build the frontend, static assets, and backend api
42
40
RUN yarn build:web
43
41
RUN yarn build:statics
44
- RUN yarn build:prod
42
+ RUN yarn build:api
45
43
46
44
# install backend _again_ to build native modules and remove dev dependencies,
47
45
# then run autoclean to remove additional unnecessary files
@@ -62,17 +60,21 @@ ENV SEGMENT_WRITE_KEY=${SEGMENT_WRITE_KEY}
62
60
ENV NODE_ENV=${NODE_ENV}
63
61
ENV SERVER_STATIC_CONTENT=true
64
62
ENV BUILD_TYPE='DOCKER_ON_PREMISE'
63
+ ENV APP_FOLDER_ABSOLUTE_PATH='/data'
65
64
66
65
# set workdir
67
66
WORKDIR /usr/src/app
68
67
69
68
# copy artifacts built in previous stage to this one
70
- COPY --from=build /usr/src/app/redisinsight/api/dist ./redisinsight/api/dist
71
- COPY --from=build /usr/src/app/redisinsight/api/node_modules ./redisinsight/api/node_modules
72
- COPY --from=build /usr/src/app/redisinsight/ui/dist ./redisinsight/ui/dist
69
+ COPY --from=build --chown=node:node /usr/src/app/redisinsight/api/dist ./redisinsight/api/dist
70
+ COPY --from=build --chown=node:node /usr/src/app/redisinsight/api/node_modules ./redisinsight/api/node_modules
71
+ COPY --from=build --chown=node:node /usr/src/app/redisinsight/ui/dist ./redisinsight/ui/dist
72
+
73
+ # folder to store local database, plugins, logs and all other files
74
+ RUN mkdir -p /data && chown -R node:node /data
73
75
74
76
# copy the docker entry point script and make it executable
75
- COPY ./docker-entry.sh ./
77
+ COPY --chown=node:node ./docker-entry.sh ./
76
78
RUN chmod +x docker-entry.sh
77
79
78
80
# since RI is hard-code to port 5000, expose it from the container
0 commit comments