-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding containers to simulate multiple clients
- Loading branch information
Showing
5 changed files
with
51 additions
and
0 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,23 @@ | ||
FROM golang:1.23-alpine AS builder | ||
|
||
WORKDIR /app | ||
|
||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
|
||
COPY . . | ||
|
||
RUN go build -o /goback main.go | ||
|
||
FROM alpine:latest | ||
|
||
RUN apk add openssh | ||
|
||
RUN mkdir -p /app/private /app/data | ||
|
||
RUN ssh-keygen -t rsa -b 4096 -f /app/private/id_rsa | ||
|
||
COPY --from=builder /goback /usr/local/bin/goback | ||
|
||
CMD ["goback"] | ||
|
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 |
---|---|---|
|
@@ -2,6 +2,9 @@ BINARY=goback | |
|
||
all: build | ||
|
||
poner: #install but in spanish | ||
go install | ||
|
||
tidy: | ||
go mod tidy | ||
|
||
|
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,22 @@ | ||
services: | ||
server: | ||
build: . | ||
command: ["goback", "server"] | ||
ports: | ||
- "8080:8080" # Replace with your server's port | ||
volumes: | ||
- ./data:/app/data | ||
- ./private/id_rsa:/app/private/id_rsa | ||
client: | ||
tty: true | ||
stdin_open: true | ||
build: . | ||
command: ["goback", "client"] | ||
depends_on: | ||
- server | ||
environment: | ||
- TERM=xterm-256color # Add any environment variables needed for the client | ||
volumes: | ||
- ./data:/app/data | ||
deploy: | ||
replicas: 1 # Specifies the number of client replicas |
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