Skip to content

Commit 3a4f000

Browse files
Artemnelsonwellsredis
authored andcommitted
fix working files owner + small changes (#2773)
1 parent 4cd8776 commit 3a4f000

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

Dockerfile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@ ENV SERVER_TLS_KEY=${SERVER_TLS_KEY}
1717
ENV SEGMENT_WRITE_KEY=${SEGMENT_WRITE_KEY}
1818

1919
# 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 \
2221
python3 \
2322
make \
24-
g++ \
25-
net-tools
23+
g++
2624

2725
# set workdir
2826
WORKDIR /usr/src/app
@@ -41,7 +39,7 @@ RUN yarn --cwd redisinsight/api install
4139
# build the frontend, static assets, and backend api
4240
RUN yarn build:web
4341
RUN yarn build:statics
44-
RUN yarn build:prod
42+
RUN yarn build:api
4543

4644
# install backend _again_ to build native modules and remove dev dependencies,
4745
# then run autoclean to remove additional unnecessary files
@@ -62,17 +60,21 @@ ENV SEGMENT_WRITE_KEY=${SEGMENT_WRITE_KEY}
6260
ENV NODE_ENV=${NODE_ENV}
6361
ENV SERVER_STATIC_CONTENT=true
6462
ENV BUILD_TYPE='DOCKER_ON_PREMISE'
63+
ENV APP_FOLDER_ABSOLUTE_PATH='/data'
6564

6665
# set workdir
6766
WORKDIR /usr/src/app
6867

6968
# 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
7375

7476
# copy the docker entry point script and make it executable
75-
COPY ./docker-entry.sh ./
77+
COPY --chown=node:node ./docker-entry.sh ./
7678
RUN chmod +x docker-entry.sh
7779

7880
# since RI is hard-code to port 5000, expose it from the container

0 commit comments

Comments
 (0)