Compare commits

..

2 Commits

Author SHA1 Message Date
63bbd4610f added docker stuff 2022-05-17 01:56:05 +02:00
9eb68a1d7e improved Makefile 2022-05-17 01:55:32 +02:00
4 changed files with 48 additions and 2 deletions

1
.dockerignore Symbolic link
View File

@@ -0,0 +1 @@
.gitignore

21
Dockerfile Normal file
View File

@@ -0,0 +1,21 @@
FROM node as jsbuild
ADD . /app
WORKDIR /app
RUN make deps && make js
FROM golang as gobuild
ADD . /app
WORKDIR /app
RUN make go
FROM gcr.io/distroless/base-debian10
COPY --from=gobuild /app/build/s3share /app/s3share
COPY --from=jsbuild /app/build/public /app/public
ENTRYPOINT [ "/app/s3share" ]

View File

@@ -5,13 +5,19 @@ BUILD_DIR = build
all: clean deps build
.PHONY:build
build: $(BUILD_DIR)/$(BINARY) $(BUILD_DIR)/public
build: go js
.PHONY: js
js: $(BUILD_DIR)/public
.PHONY: go
go: $(BUILD_DIR)/$(BINARY)
$(BUILD_DIR)/$(BINARY):
go build -o $(BUILD_DIR)/$(BINARY) cmd/s3share.go
$(BUILD_DIR)/public:
npm run build && cp -r public/ $(BUILD_DIR)/public
npm run build && mkdir -p $(BUILD_DIR) &&cp -r public/ $(BUILD_DIR)/public
.PHONY: deps
deps: node_modules

18
docker-compose.yml Normal file
View File

@@ -0,0 +1,18 @@
version: "3"
services:
s3share:
build: .
image: djeeberjr/s3share
ports:
- "80:3000"
environment:
- S3_ENDPOINT=localhost:9000
- S3_BUCKET=dev
- S3_ACCESS_KEY=dev
- S3_SECRET_KEY=hunter22
- S3_DISABLE_SSL=true
- ADDRESS=:3000
- API_USERNAME=admin
- API_PASSWORD=hunter2
- DB_CONNECTION=dev:hunter22@localhost/dev