This repository was archived by the owner on May 7, 2025. It is now read-only.
generated from evstack/template-da-repo
-
Notifications
You must be signed in to change notification settings - Fork 4
chore: add dockerfile, add rollup id to cmd options #27
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,42 @@ | ||
| # Build stage | ||
| FROM --platform=$BUILDPLATFORM golang:1.23-alpine AS build-env | ||
|
|
||
| # Set the working directory for the build | ||
| WORKDIR /src | ||
|
|
||
| # Copy Go modules and source code | ||
| COPY go.mod go.sum ./ | ||
| RUN go mod download | ||
|
|
||
| # Copy the rest of the source code | ||
| COPY . . | ||
|
|
||
| # Build the Go program | ||
| RUN go mod tidy -compat=1.23 && \ | ||
| go build -o centralized-sequencer /src/cmd/centralized-sequencer/main.go | ||
gupadhyaya marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # Final image | ||
| FROM alpine:3.18.3 | ||
|
|
||
| # Set the working directory | ||
| WORKDIR /root | ||
|
|
||
| # Copy the binary from the build stage | ||
| COPY --from=build-env /src/centralized-sequencer /usr/bin/local-sequencer | ||
|
|
||
| # Expose the application's port | ||
| EXPOSE 50051 | ||
gupadhyaya marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # Define arguments as environment variables, which can be set when running the container | ||
| ENV HOST=localhost | ||
| ENV PORT=50051 | ||
| ENV LISTEN_ALL=false | ||
| ENV BATCH_TIME=2s | ||
| ENV DA_ADDRESS=http://localhost:26658 | ||
| ENV DA_NAMESPACE="" | ||
| ENV DA_AUTH_TOKEN="" | ||
| ENV DB_PATH="~/.centralized-sequencer-db" | ||
| ENV ROLLUP_ID="rollupId" | ||
gupadhyaya marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # Run the application with environment variables passed as flags | ||
| CMD ["sh", "-c", "/usr/bin/local-sequencer -host $HOST -port $PORT -listen-all=$LISTEN_ALL -batch-time $BATCH_TIME -da_address $DA_ADDRESS -da_namespace $DA_NAMESPACE -da_auth_token $DA_AUTH_TOKEN -db_path $DB_PATH"] | ||
gupadhyaya marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.