added dockerfile

This commit is contained in:
Djeeberjr 2021-09-09 19:11:55 +02:00
parent f2c8be33da
commit e582c8e483
3 changed files with 57 additions and 0 deletions

3
.dockerignore Normal file
View File

@ -0,0 +1,3 @@
/s3browser-backend/internal/static
/s3browser-frontend/node_modules
/s3browser-frontend/build

23
Dockerfile Normal file
View File

@ -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" ]

31
docker-compose.yml Normal file
View File

@ -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