-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Closes #185, Dockerized the application. Created Dockerfiles fo…
…r dev and prod environments, created a docker compose config file to run the s3 and proxy servers in dev environments with live code update and container recreation. Added commands in Makefile to run s3, proxy and both servers as docker containers
- Loading branch information
Showing
6 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Binaries for programs and plugins | ||
*.exe | ||
*.exe~ | ||
*.dll | ||
*.so | ||
*.dylib | ||
cmd/versitygw/versitygw | ||
/versitygw | ||
|
||
# Test binary, built with `go test -c` | ||
*.test | ||
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
|
||
# Go workspace file | ||
go.work | ||
|
||
# ignore IntelliJ directories | ||
.idea | ||
|
||
# auto generated VERSION file | ||
VERSION | ||
|
||
# build output | ||
/versitygw.spec | ||
/versitygw.spec.in | ||
*.tar | ||
*.tar.gz | ||
**/rand.data | ||
/profile.txt | ||
|
||
dist/ | ||
|
||
# Release config files | ||
/.github | ||
|
||
# Docker configuration files | ||
*Dockerfile | ||
/docker-compose.yml | ||
|
||
# read files | ||
/LICENSE | ||
/NOTICE | ||
/CODE_OF_CONDUCT.md | ||
/README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
POSIX_PORT= | ||
PROXY_PORT= | ||
ACCESS_KEY_ID= | ||
SECRET_ACCESS_KEY= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM golang:1.20-alpine | ||
|
||
WORKDIR /app | ||
|
||
COPY go.mod ./ | ||
RUN go mod download | ||
|
||
COPY ./ ./ | ||
|
||
WORKDIR /app/cmd/versitygw | ||
RUN go build -o versitygw | ||
|
||
RUN mkdir /tmp/vgw | ||
|
||
ENTRYPOINT [ "./versitygw" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM golang:1.20 | ||
|
||
WORKDIR /app | ||
|
||
COPY go.mod ./ | ||
RUN go mod download | ||
|
||
COPY ./ ./ | ||
|
||
RUN mkdir /tmp/vgw | ||
|
||
RUN go get github.com/githubnemo/CompileDaemon | ||
RUN go install github.com/githubnemo/CompileDaemon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
version: "3" | ||
services: | ||
posix: | ||
build: | ||
context: . | ||
dockerfile: ./Dockerfile.dev | ||
volumes: | ||
- ./:/app | ||
ports: | ||
- "${POSIX_PORT}:${POSIX_PORT}" | ||
command: ["sh", "-c", CompileDaemon -build="go build -C ./cmd/versitygw -o versitygw" -command="./cmd/versitygw/versitygw -p :$POSIX_PORT -a $ACCESS_KEY_ID -s $SECRET_ACCESS_KEY --iam-dir /tmp/vgw posix /tmp/vgw"] | ||
proxy: | ||
build: | ||
context: . | ||
dockerfile: ./Dockerfile.dev | ||
volumes: | ||
- ./:/app | ||
ports: | ||
- "${PROXY_PORT}:${PROXY_PORT}" | ||
command: ["sh", "-c", CompileDaemon -build="go build -C ./cmd/versitygw -o versitygw" -command="./cmd/versitygw/versitygw -a $ACCESS_KEY_ID -s $SECRET_ACCESS_KEY -p :$PROXY_PORT s3 --endpoint http://posix:$POSIX_PORT"] |