Skip to content

Commit 57841d1

Browse files
authored
add skeleton for next-backend service (#1629)
* init commit * upd branch
1 parent 8d752cb commit 57841d1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+7565
-2
lines changed

.dockerignore

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# flyctl launch added from .gitignore
2+
**/.idea
3+
**/.DS_Store
4+
**/venv
5+
**/**/__pycache__
6+
**/__azurite*
7+
8+
# flyctl launch added from backend/.gitignore
9+
backend/**/backend
10+
backend/**/main
11+
backend/**/.idea
12+
backend/**/.DS_Store
13+
backend/**/venv
14+
backend/**/**/__pycache__
15+
backend/**/__azurite*
16+
backend/**/digger
17+
backend/**/cloud
18+
backend/**/*.env
19+
backend/**/*.env.*
20+
backend/**/.docker-compose-env
21+
backend/**/controllers/database_test.db
22+
23+
# flyctl launch added from backend/tasks/.gitignore
24+
backend/tasks/**/.env
25+
backend/tasks/**/tasks
26+
27+
# flyctl launch added from cli/.gitignore
28+
cli/**/**/digger
29+
!cli/pkg/digger
30+
!cli/cmd/digger
31+
32+
# flyctl launch added from dgctl/.gitignore
33+
dgctl/**/.archive
34+
dgctl/**/generated
35+
dgctl/**/dgctl.generated.json
36+
dgctl/**/.dgctl
37+
dgctl/**/dgctl
38+
39+
# flyctl launch added from ee/backend/.gitignore
40+
ee/backend/**/main
41+
ee/backend/**/backend
42+
ee/backend/**/.idea
43+
ee/backend/**/.DS_Store
44+
ee/backend/**/venv
45+
ee/backend/**/**/__pycache__
46+
ee/backend/**/__azurite*
47+
ee/backend/**/digger
48+
ee/backend/**/cloud
49+
ee/backend/**/*.env
50+
ee/backend/**/*.env.*
51+
ee/backend/**/.docker-compose-env
52+
ee/backend/**/controllers/database_test.db
53+
54+
# flyctl launch added from ee/cli/.gitignore
55+
ee/cli/**/**/digger
56+
!ee/cli/pkg/digger
57+
!ee/cli/cmd/digger
58+
59+
# flyctl launch added from libs/digger_config/.gitignore
60+
libs/digger_config/**/.idea
61+
62+
# flyctl launch added from libs/orchestrator/.gitignore
63+
libs/orchestrator/**/.idea

.github/workflows/next_deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
push:
44
branches:
55
- develop # change to main if needed
6-
- feat/next
6+
- feat/nxt
77
pull_request:
88
branches:
99
- feat/next

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.idea/
2+
**/.env
23
.DS_Store
34
venv/
45
**/__pycache__/
5-
__azurite*
6+
__azurite*

Dockerfile_next

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
FROM golang:1.22 as builder
2+
ARG COMMIT_SHA
3+
RUN echo "commit sha: ${COMMIT_SHA}"
4+
5+
# Set the working directory
6+
WORKDIR $GOPATH/src/github.com/diggerhq/digger
7+
8+
# Copy all required source, blacklist files that are not required through `.dockerignore`
9+
COPY . .
10+
11+
# Get the vendor library
12+
RUN go version
13+
14+
# RUN vgo install
15+
16+
# https://github.com/ethereum/go-ethereum/issues/2738
17+
# Build static binary "-getmode=vendor" does not work with go-ethereum
18+
19+
RUN go build -ldflags="-X 'main.Version=${COMMIT_SHA}'" -o next_exe ./next/
20+
21+
# Multi-stage build will just copy the binary to an alpine image.
22+
FROM ubuntu:24.04 as runner
23+
ENV ATLAS_VERSION v0.16.0
24+
ARG COMMIT_SHA
25+
WORKDIR /app
26+
27+
RUN apt-get update && apt-get install -y ca-certificates curl && apt-get install -y git && apt-get clean all
28+
RUN update-ca-certificates
29+
30+
RUN echo "commit sha: ${COMMIT_SHA}"
31+
32+
# install atlas
33+
RUN curl -sSf https://atlasgo.sh | sh
34+
35+
36+
37+
# Set gin to production
38+
#ENV GIN_MODE=release
39+
40+
# Expose the running port
41+
EXPOSE 3000
42+
43+
# Copy the binary to the corresponding folder
44+
COPY --from=builder /go/src/github.com/diggerhq/digger/next_exe /app/next
45+
COPY --from=builder /go/src/github.com/diggerhq/digger/next/scripts/entrypoint.sh /app/entrypoint.sh
46+
ADD next/templates ./templates
47+
48+
# Run the binary
49+
ENTRYPOINT ["/bin/bash", "/app/entrypoint.sh"]

fly.toml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# fly.toml app configuration file generated for next-backend on 2024-07-19T08:47:44+01:00
2+
#
3+
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
4+
#
5+
6+
app = 'next-backend'
7+
primary_region = 'lhr'
8+
kill_signal = 'SIGINT'
9+
kill_timeout = '5s'
10+
11+
[build]
12+
dockerfile = 'Dockerfile_next'
13+
14+
[[services]]
15+
protocol = 'tcp'
16+
internal_port = 3000
17+
processes = ['app']
18+
19+
[[services.ports]]
20+
port = 80
21+
handlers = ['http']
22+
force_https = true
23+
24+
[[services.ports]]
25+
port = 443
26+
handlers = ['tls', 'http']
27+
28+
[services.concurrency]
29+
type = 'connections'
30+
hard_limit = 25
31+
soft_limit = 20
32+
33+
[[vm]]
34+
memory = '1gb'
35+
cpu_kind = 'shared'
36+
cpus = 1

go.work

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use (
55
./cli
66
./cli_e2e
77
./dgctl
8+
./next
89

910
./ee/backend
1011
./ee/cli

next/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.env

0 commit comments

Comments
 (0)