aboutsummaryrefslogtreecommitdiff
path: root/.github/docker
diff options
context:
space:
mode:
Diffstat (limited to '.github/docker')
-rw-r--r--.github/docker/Dockerfile-backend17
-rw-r--r--.github/docker/Dockerfile-frontend7
-rw-r--r--.github/docker/docker-compose.yml22
3 files changed, 46 insertions, 0 deletions
diff --git a/.github/docker/Dockerfile-backend b/.github/docker/Dockerfile-backend
new file mode 100644
index 0000000..82ed29f
--- /dev/null
+++ b/.github/docker/Dockerfile-backend
@@ -0,0 +1,17 @@
+FROM golang:1.16
+
+RUN apt-get update && \
+ DEBIAN_FRONTEND=noninteractive apt-get install -qq \
+ git \
+ pkg-config \
+ libpcap-dev \
+ libhyperscan-dev
+
+WORKDIR /caronte
+
+COPY . ./
+
+RUN go mod download && \
+ go build
+
+ENTRYPOINT go test -v -race -covermode=atomic
diff --git a/.github/docker/Dockerfile-frontend b/.github/docker/Dockerfile-frontend
new file mode 100644
index 0000000..5cd82b0
--- /dev/null
+++ b/.github/docker/Dockerfile-frontend
@@ -0,0 +1,7 @@
+FROM node:16
+
+WORKDIR /caronte-frontend
+
+COPY ./frontend ./
+
+RUN yarn install && yarn build
diff --git a/.github/docker/docker-compose.yml b/.github/docker/docker-compose.yml
new file mode 100644
index 0000000..ddaf839
--- /dev/null
+++ b/.github/docker/docker-compose.yml
@@ -0,0 +1,22 @@
+version: "3.7"
+services:
+
+ mongo:
+ image: mongo:4.4
+
+ test-backend:
+ build:
+ context: ../../
+ dockerfile: .github/docker/Dockerfile-backend
+ image: caronte-test-backend
+ depends_on:
+ - mongo
+ environment:
+ MONGO_HOST: mongo
+ MONGO_PORT: 27017
+
+ test-frontend:
+ build:
+ context: ../../
+ dockerfile: .github/docker/Dockerfile-frontend
+ image: caronte-test-frontend