Skip to content

Commit d42996c

Browse files
author
Alwin Lohrie
committed
Add Dockerfile and docker-compose.yml
1 parent 4fe4374 commit d42996c

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM golang:alpine AS builder
2+
3+
WORKDIR /usr/src/app
4+
5+
COPY . .
6+
RUN apk add make openssh
7+
RUN make build
8+
9+
10+
FROM alpine
11+
12+
RUN apk add openssh
13+
RUN mkdir /root/.ssh
14+
WORKDIR /root/.ssh
15+
RUN ssh-keygen -t rsa -C "chatkey" -f id_rsa
16+
17+
WORKDIR /usr/local/bin
18+
19+
COPY --from=builder /usr/src/app/ssh-chat .
20+
RUN chmod +x ssh-chat
21+
CMD ["/usr/local/bin/ssh-chat"]

docker-compose.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: '3'
2+
services:
3+
app:
4+
build: .
5+
ports:
6+
- 2022:2022
7+
restart: always

0 commit comments

Comments
 (0)