-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: auth support with dockerfile (#15)
Co-authored-by: pshubham <[email protected]>
- Loading branch information
1 parent
1f6392a
commit 62d5d90
Showing
12 changed files
with
144 additions
and
30 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,8 @@ | ||
DICEDB_ADDR=localhost:7379 | ||
DICEDB_USERNAME=dice | ||
DICEDB_PASSWORD= | ||
SERVER_PORT=:8080 | ||
IS_TEST_ENVIRONMENT=false | ||
REQUEST_LIMIT_PER_MIN=1000 | ||
REQUEST_WINDOW_SEC=60 | ||
ALLOWED_ORIGINS=http://localhost:3000 |
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 @@ | ||
# Stage 1: Build the Go application | ||
FROM golang:1.23 AS go-builder | ||
WORKDIR /app | ||
COPY go.mod go.sum ./ | ||
RUN go mod download -x | ||
COPY . . | ||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o playground-mono . | ||
|
||
# Stage 2: Build the final container with the Go binary | ||
FROM alpine:latest | ||
RUN apk --no-cache add ca-certificates | ||
WORKDIR /app | ||
COPY --from=go-builder /app/playground-mono . | ||
EXPOSE 8080 | ||
CMD ["./playground-mono"] |
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
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,31 @@ | ||
services: | ||
dicedb: | ||
image: dicedb/dicedb:latest | ||
ports: | ||
- "7379:7379" | ||
healthcheck: | ||
test: ["CMD", "PING"] | ||
interval: 10s | ||
timeout: 3s | ||
retries: 3 | ||
networks: | ||
- dice-network | ||
|
||
backend: | ||
build: | ||
context: . | ||
ports: | ||
- "8080:8080" | ||
depends_on: | ||
- dicedb | ||
environment: | ||
- DICEDB_ADDR=localhost:7379 | ||
- DICEDB_USERNAME=${DICEDB_USERNAME} | ||
- DICEDB_PASSWORD=${DICEDB_PASSWORD} | ||
networks: | ||
- dice-network | ||
|
||
networks: | ||
dice-network: | ||
driver: bridge | ||
|
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
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
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
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