From 2f5a7918d239d0b190b2279415833adb4bdd1e47 Mon Sep 17 00:00:00 2001 From: Lilleman Date: Wed, 23 Jun 2021 22:59:27 +0200 Subject: [PATCH] Added tests to docker-compose --- docker-compose.yml | 14 +++++++++++++- tests/.dockerignore | 2 ++ tests/Dockerfile | 11 +++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 tests/.dockerignore create mode 100644 tests/Dockerfile diff --git a/docker-compose.yml b/docker-compose.yml index 9996962..c8d30db 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -31,4 +31,16 @@ services: depends_on: - postgres ports: - - 4000:4000 \ No newline at end of file + - 4000:4000 + + tests: + build: + context: tests + environment: + - ADMIN_API_KEY=hihi + - AUTH_URL=http://auth:4000 + - JWT_SHARED_SECRET=hihi + profiles: ["tests"] + depends_on: + - auth + #command: ls -l diff --git a/tests/.dockerignore b/tests/.dockerignore new file mode 100644 index 0000000..97aca2e --- /dev/null +++ b/tests/.dockerignore @@ -0,0 +1,2 @@ +.env +node_modules \ No newline at end of file diff --git a/tests/Dockerfile b/tests/Dockerfile new file mode 100644 index 0000000..09aebd9 --- /dev/null +++ b/tests/Dockerfile @@ -0,0 +1,11 @@ +FROM node:16.3.0-slim + +WORKDIR /srv + +COPY package* ./ + +RUN npm ci + +COPY . ./ + +CMD ["npm", "run", "test"] \ No newline at end of file