-
Notifications
You must be signed in to change notification settings - Fork 562
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add skeleton for next-backend service (#1629)
* init commit * upd branch
- Loading branch information
Showing
45 changed files
with
7,565 additions
and
2 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,63 @@ | ||
# flyctl launch added from .gitignore | ||
**/.idea | ||
**/.DS_Store | ||
**/venv | ||
**/**/__pycache__ | ||
**/__azurite* | ||
|
||
# flyctl launch added from backend/.gitignore | ||
backend/**/backend | ||
backend/**/main | ||
backend/**/.idea | ||
backend/**/.DS_Store | ||
backend/**/venv | ||
backend/**/**/__pycache__ | ||
backend/**/__azurite* | ||
backend/**/digger | ||
backend/**/cloud | ||
backend/**/*.env | ||
backend/**/*.env.* | ||
backend/**/.docker-compose-env | ||
backend/**/controllers/database_test.db | ||
|
||
# flyctl launch added from backend/tasks/.gitignore | ||
backend/tasks/**/.env | ||
backend/tasks/**/tasks | ||
|
||
# flyctl launch added from cli/.gitignore | ||
cli/**/**/digger | ||
!cli/pkg/digger | ||
!cli/cmd/digger | ||
|
||
# flyctl launch added from dgctl/.gitignore | ||
dgctl/**/.archive | ||
dgctl/**/generated | ||
dgctl/**/dgctl.generated.json | ||
dgctl/**/.dgctl | ||
dgctl/**/dgctl | ||
|
||
# flyctl launch added from ee/backend/.gitignore | ||
ee/backend/**/main | ||
ee/backend/**/backend | ||
ee/backend/**/.idea | ||
ee/backend/**/.DS_Store | ||
ee/backend/**/venv | ||
ee/backend/**/**/__pycache__ | ||
ee/backend/**/__azurite* | ||
ee/backend/**/digger | ||
ee/backend/**/cloud | ||
ee/backend/**/*.env | ||
ee/backend/**/*.env.* | ||
ee/backend/**/.docker-compose-env | ||
ee/backend/**/controllers/database_test.db | ||
|
||
# flyctl launch added from ee/cli/.gitignore | ||
ee/cli/**/**/digger | ||
!ee/cli/pkg/digger | ||
!ee/cli/cmd/digger | ||
|
||
# flyctl launch added from libs/digger_config/.gitignore | ||
libs/digger_config/**/.idea | ||
|
||
# flyctl launch added from libs/orchestrator/.gitignore | ||
libs/orchestrator/**/.idea |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
.idea/ | ||
**/.env | ||
.DS_Store | ||
venv/ | ||
**/__pycache__/ | ||
__azurite* | ||
__azurite* |
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,49 @@ | ||
FROM golang:1.22 as builder | ||
ARG COMMIT_SHA | ||
RUN echo "commit sha: ${COMMIT_SHA}" | ||
|
||
# Set the working directory | ||
WORKDIR $GOPATH/src/github.com/diggerhq/digger | ||
|
||
# Copy all required source, blacklist files that are not required through `.dockerignore` | ||
COPY . . | ||
|
||
# Get the vendor library | ||
RUN go version | ||
|
||
# RUN vgo install | ||
|
||
# https://github.com/ethereum/go-ethereum/issues/2738 | ||
# Build static binary "-getmode=vendor" does not work with go-ethereum | ||
|
||
RUN go build -ldflags="-X 'main.Version=${COMMIT_SHA}'" -o next_exe ./next/ | ||
|
||
# Multi-stage build will just copy the binary to an alpine image. | ||
FROM ubuntu:24.04 as runner | ||
ENV ATLAS_VERSION v0.16.0 | ||
ARG COMMIT_SHA | ||
WORKDIR /app | ||
|
||
RUN apt-get update && apt-get install -y ca-certificates curl && apt-get install -y git && apt-get clean all | ||
RUN update-ca-certificates | ||
|
||
RUN echo "commit sha: ${COMMIT_SHA}" | ||
|
||
# install atlas | ||
RUN curl -sSf https://atlasgo.sh | sh | ||
|
||
|
||
|
||
# Set gin to production | ||
#ENV GIN_MODE=release | ||
|
||
# Expose the running port | ||
EXPOSE 3000 | ||
|
||
# Copy the binary to the corresponding folder | ||
COPY --from=builder /go/src/github.com/diggerhq/digger/next_exe /app/next | ||
COPY --from=builder /go/src/github.com/diggerhq/digger/next/scripts/entrypoint.sh /app/entrypoint.sh | ||
ADD next/templates ./templates | ||
|
||
# Run the binary | ||
ENTRYPOINT ["/bin/bash", "/app/entrypoint.sh"] |
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,36 @@ | ||
# fly.toml app configuration file generated for next-backend on 2024-07-19T08:47:44+01:00 | ||
# | ||
# See https://fly.io/docs/reference/configuration/ for information about how to use this file. | ||
# | ||
|
||
app = 'next-backend' | ||
primary_region = 'lhr' | ||
kill_signal = 'SIGINT' | ||
kill_timeout = '5s' | ||
|
||
[build] | ||
dockerfile = 'Dockerfile_next' | ||
|
||
[[services]] | ||
protocol = 'tcp' | ||
internal_port = 3000 | ||
processes = ['app'] | ||
|
||
[[services.ports]] | ||
port = 80 | ||
handlers = ['http'] | ||
force_https = true | ||
|
||
[[services.ports]] | ||
port = 443 | ||
handlers = ['tls', 'http'] | ||
|
||
[services.concurrency] | ||
type = 'connections' | ||
hard_limit = 25 | ||
soft_limit = 20 | ||
|
||
[[vm]] | ||
memory = '1gb' | ||
cpu_kind = 'shared' | ||
cpus = 1 |
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 |
---|---|---|
|
@@ -5,6 +5,7 @@ use ( | |
./cli | ||
./cli_e2e | ||
./dgctl | ||
./next | ||
|
||
./ee/backend | ||
./ee/cli | ||
|
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 @@ | ||
.env |
Oops, something went wrong.