Skip to content

Commit

Permalink
feat(torch): docs updated
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Ramon Mañes <[email protected]>
  • Loading branch information
tty47 committed Oct 25, 2023
1 parent 9226395 commit 252b8f1
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 32 deletions.
32 changes: 29 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,38 @@
FROM golang:1.21.0-bullseye AS builder
# stage 1 Generate celestia-appd Binary
FROM --platform=$BUILDPLATFORM docker.io/golang:1.21.3-alpine3.18 as builder

ARG TARGETOS
ARG TARGETARCH
ENV CGO_ENABLED=0
ENV GO111MODULE=on

WORKDIR /

COPY go.mod go.sum ./
# Download dependencies
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /go/bin/torch ./cmd/main.go
RUN CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o /go/bin/torch ./cmd/main.go

FROM alpine:latest
# stage 2
FROM docker.io/alpine:3.18.4
WORKDIR /
# Read here why UID 10001: https://github.com/hexops/dockerfile/blob/main/README.md#do-not-use-a-uid-below-10000
ARG UID=10001
ARG USER_NAME=torch

ENV USR_HOME=/home/${USER_NAME}

# hadolint ignore=DL3018
RUN adduser ${USER_NAME} \
-D \
-g ${USER_NAME} \
-h ${USR_HOME} \
-s /sbin/nologin \
-u ${UID}

COPY --from=builder /go/bin/torch .

EXPOSE 8080

ENTRYPOINT ["./torch"]
27 changes: 25 additions & 2 deletions Dockerfile_local
Original file line number Diff line number Diff line change
@@ -1,11 +1,34 @@
FROM golang:1.21.0-bullseye AS builder
# stage 1 Generate celestia-appd Binary
FROM --platform=$BUILDPLATFORM docker.io/golang:1.21.3-alpine3.18 as builder

ARG TARGETOS
ARG TARGETARCH

WORKDIR /
COPY go.mod go.sum ./
# Download dependencies
RUN go mod download
COPY torch /go/bin/torch

FROM alpine:latest
# stage 2
FROM docker.io/alpine:3.18.4
WORKDIR /
# Read here why UID 10001: https://github.com/hexops/dockerfile/blob/main/README.md#do-not-use-a-uid-below-10000
ARG UID=10001
ARG USER_NAME=torch

ENV USR_HOME=/home/${USER_NAME}

# hadolint ignore=DL3018
RUN adduser ${USER_NAME} \
-D \
-g ${USER_NAME} \
-h ${USR_HOME} \
-s /sbin/nologin \
-u ${UID}

COPY --from=builder /go/bin/torch .

EXPOSE 8080

ENTRYPOINT ["./torch"]
27 changes: 0 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,33 +96,6 @@ There are two types of connections:
}
```

- `/api/v1/genAll`
- **Method**: `POST`
- **Description**: Generate the config for all the peers in the config file
- **Body Example**:

```json
{
"podName":
[
"da-bridge-1",
"da-full-1"
]
}
```

- **Response Example**:

```json
{
"status": 200,
"body": {
"da-bridge-0": "/dns/da-bridge-1/tcp/2121/p2p/12D3KooWDMuPiHgnB6xwnpaR4cgyAdbB5aN9zwoZCATgGxnrpk1M",
"da-full-0": "/dns/da-full-1/tcp/2121/p2p/12D3KooWDCUaPA5ZQveFfsuAHHBNiAhEERo5J1YfbqwSZKtn9RrD"
}
}
```

- `/metrics`
- **Method**: `GET`
- **Description**: Prometheus metrics endpoint.
Expand Down

0 comments on commit 252b8f1

Please sign in to comment.