Skip to content

Commit

Permalink
add docker files
Browse files Browse the repository at this point in the history
  • Loading branch information
amalshaji committed Nov 21, 2023
1 parent f2da1b6 commit f1f3ed4
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
1 change: 0 additions & 1 deletion configs/server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ ssh:
proxy:
host: localhost
port: 8001

secure: false
debug: true
23 changes: 23 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM golang:1.21.4 AS builder

WORKDIR /app

COPY go.mod go.sum /app/

RUN go mod download

COPY . /app/

RUN CGO_ENABLED=1 go build -ldflags="-s -w -linkmode external -extldflags \"-static\"" -o localportd ./cmd/localportd

FROM alpine:3.18.4

WORKDIR /app

COPY --from=builder /app/localportd /app/

VOLUME [ "/app/configs" ]
VOLUME [ "/app/data" ]

ENTRYPOINT ["./localportd", "start"]
CMD [ "--config", "/app/config.yml" ]
14 changes: 14 additions & 0 deletions docker/docker-compose.dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
services:
localport:
build:
context: ..
dockerfile: docker/Dockerfile
volumes:
- ../configs/server.yaml:/app/config.yml
- ../data:/app/data/
- ../keys:/app/keys/
ports:
- 8000:8000
- 8001:8001
- 2222:2222
restart: unless-stopped

0 comments on commit f1f3ed4

Please sign in to comment.