From e582c8e4832ee31ddae3594169b1afb578c128be Mon Sep 17 00:00:00 2001 From: Djeeberjr Date: Thu, 9 Sep 2021 19:11:55 +0200 Subject: [PATCH] added dockerfile --- .dockerignore | 3 +++ Dockerfile | 23 +++++++++++++++++++++++ docker-compose.yml | 31 +++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..2f5d77e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +/s3browser-backend/internal/static +/s3browser-frontend/node_modules +/s3browser-frontend/build diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..81a8514 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM node as jsbuild + +ADD s3browser-frontend /s3browser-frontend +WORKDIR /s3browser-frontend + +RUN yarn install +RUN yarn run build + +FROM golang as gobuild + +ADD s3browser-backend /s3browser-backend + +WORKDIR /s3browser-backend + +COPY --from=jsbuild /s3browser-frontend/build /s3browser-backend/internal/static + +RUN go build -o s3browser -tags prod ./cmd/s3Browser.go + +FROM gcr.io/distroless/base-debian10 + +COPY --from=gobuild /s3browser-backend/s3browser / + +CMD [ "/s3browser" ] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..8da70b8 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,31 @@ +version: "3" + +services: + s3browser: + build: . + ports: + - 80:3000 + environment: + - S3_ENDPOINT=s3:9000 + - S3_ACCESS_KEY=testo + - S3_SECRET_KEY=testotesto + - S3_BUKET=dev + - S3_DISABLE_SSL=true + - ADDRESS=:3000 + - VERBOSE=false + restart: unless-stopped + s3: + container_name: s3 + image: minio/minio + environment: + - MINIO_ROOT_USER=admin + - MINIO_ROOT_PASSWORD=hunter22 + ports: + - 9000:9000 + - 9001:9001 + command: server /data --console-address ":9001" + volumes: + - s3_dev:/data +volumes: + s3_dev: + name: s3_dev \ No newline at end of file