Merge pull request #366 from Niwla23/dockerfiles

Add Dockerfile and docker-compose.yml
This commit is contained in:
Andrey Petrov 2020-10-29 09:48:30 -04:00 committed by GitHub
commit 5fb947fa6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 0 deletions

21
Dockerfile Normal file
View File

@ -0,0 +1,21 @@
FROM golang:alpine AS builder
WORKDIR /usr/src/app
COPY . .
RUN apk add make openssh
RUN make build
FROM alpine
RUN apk add openssh
RUN mkdir /root/.ssh
WORKDIR /root/.ssh
RUN ssh-keygen -t rsa -C "chatkey" -f id_rsa
WORKDIR /usr/local/bin
COPY --from=builder /usr/src/app/ssh-chat .
RUN chmod +x ssh-chat
CMD ["/usr/local/bin/ssh-chat"]

7
docker-compose.yml Normal file
View File

@ -0,0 +1,7 @@
version: '3'
services:
app:
build: .
ports:
- 2022:2022
restart: always