aboutsummaryrefslogtreecommitdiff
path: root/.github/docker
diff options
context:
space:
mode:
authorEmiliano Ciavatta2021-07-28 18:12:14 +0000
committerEmiliano Ciavatta2021-07-28 18:12:14 +0000
commit99cfe84c23f3beb8baf76b799ace1b3ffbf1d5ff (patch)
tree41d8bbbe2f46051aeebf5b4ae73c46325c4bf7c6 /.github/docker
parentfdb0bf97d2dec72adf08e5f2d7ad65b560d8cf8e (diff)
parentf60d7cb1da70d439cd401e2fa4b7ecccec41bfe4 (diff)
Merge branch 'release/1.21.0' into main
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