Skip to content
4 changes: 2 additions & 2 deletions .circleci/build/build.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ RUN mkdir -p /data && chown -R node:node /data
COPY --chown=node:node ./docker-entry.sh ./
RUN chmod +x docker-entry.sh

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

# don't run the node process as root
USER node
Expand Down
4 changes: 2 additions & 2 deletions .github/build/build.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ RUN mkdir -p /data && chown -R node:node /data
COPY --chown=node:node ./docker-entry.sh ./
RUN chmod +x docker-entry.sh

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

# don't run the node process as root
USER node
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't do this. Production docker image shouldn't run under root user

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ArtemHoruzhenko fixed this. Although this is not the Dockerfile we use for production, I agree it's a good practice to run it with different user. Additionally, I think it will be nice to reuse the production Dockerfile for these tests as well, but this would be for different PR.

And a question to you - do we use circleci Dockerfile somewhere?

Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/tests-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ jobs:
run: |
docker image load -i ./release/docker/docker-linux-alpine.amd64.tar

- name: Make sure coverage dir exists
# Important: this directory is mounted on both the `app` and `test` Docker containers.
run: mkdir -p ./redisinsight/api/test/test-runs/coverage

- name: Run tests
timeout-minutes: 20
run: |
Expand All @@ -122,7 +126,7 @@ jobs:
fi

./redisinsight/api/test/test-runs/start-test-run.sh -r ${{ matrix.rte }} -t ${{ inputs.build }}
mkdir -p mkdir itest/coverages && mkdir -p itest/results
mkdir -p itest/coverages && mkdir -p itest/results

cp ./redisinsight/api/test/test-runs/coverage/test-run-result.json ./itest/results/${{ matrix.rte }}.result.json
cp ./redisinsight/api/test/test-runs/coverage/test-run-result.xml ./itest/results/${{ matrix.rte }}.result.xml
Expand Down
4 changes: 2 additions & 2 deletions redisinsight/api/test/test-runs/docker.build.env
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
COV_FOLDER=./coverage
ID=defaultid
RTE=defaultrte
APP_IMAGE=riv2:latest
TEST_BE_SERVER=https://app:5000/api
APP_IMAGE=redisinsight:amd64
TEST_BE_SERVER=http://app:5540/api
RI_NOTIFICATION_UPDATE_URL=https://s3.amazonaws.com/redisinsight.test/public/tests/notifications.json
CERTS_FOLDER=/root/.redisinsight-v2.0
15 changes: 12 additions & 3 deletions redisinsight/api/test/test-runs/docker.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ services:
dockerfile: ./test/test-runs/test.Dockerfile
tty: true
volumes:
- ${COV_FOLDER}:/usr/src/app/coverage
- ${COV_FOLDER}:/root/.redisinsight-v2.0
- shared-data:/usr/src/app/coverage
- shared-data:/root/.redisinsight-v2.0
- shared-data:/data
depends_on:
- redis
- app
Expand All @@ -34,7 +35,8 @@ services:
depends_on:
- redis
volumes:
- ${COV_FOLDER}:/root/.redisinsight-v2.0
- shared-data:/root/.redisinsight-v2.0
- shared-data:/data
environment:
RI_REDIS_CLIENTS_FORCE_STRATEGY: ${RI_REDIS_CLIENTS_FORCE_STRATEGY}
CERTS_FOLDER: "/root/.redisinsight-v2.0"
Expand All @@ -49,3 +51,10 @@ networks:
default:
name: ${ID}

volumes:
shared-data:
driver: local
driver_opts:
type: none
device: ${COV_FOLDER}
o: bind
Loading