mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-04-12 15:17:16 +03:00
Add Dockerfile and docker-compose.yml
This commit is contained in:
parent
4fe43746fe
commit
d42996c14b
21
Dockerfile
Normal file
21
Dockerfile
Normal 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
7
docker-compose.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
build: .
|
||||||
|
ports:
|
||||||
|
- 2022:2022
|
||||||
|
restart: always
|
Loading…
x
Reference in New Issue
Block a user