mirror of
https://github.com/bytedream/docker4ssh.git
synced 2025-06-27 01:40:32 +02:00
Initial commit
This commit is contained in:
47
examples/Dockerfile
Normal file
47
examples/Dockerfile
Normal file
@ -0,0 +1,47 @@
|
||||
FROM golang:1.17 as server
|
||||
|
||||
WORKDIR /docker4ssh
|
||||
|
||||
COPY ["../", "."]
|
||||
|
||||
RUN apt update && \
|
||||
apt install make sqlite3 && \
|
||||
apt clean && \
|
||||
apt autoremove && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN make BUILDDIR=build/ build-server
|
||||
|
||||
|
||||
FROM rust:1.56 as client
|
||||
|
||||
WORKDIR /docker4ssh
|
||||
|
||||
COPY ../ .
|
||||
|
||||
RUN apt update && \
|
||||
apt install make \
|
||||
|
||||
RUN make BUILDDIR=build/ build-client
|
||||
|
||||
|
||||
FROM alpine:lastest as extra
|
||||
|
||||
WORKDIR /docker4ssh
|
||||
|
||||
COPY ../ .
|
||||
|
||||
RUN apk add make
|
||||
|
||||
RUN make BUILDDIR=build/ build-extra
|
||||
|
||||
|
||||
FROM alpine:latest
|
||||
|
||||
WORKDIR /docker4ssh
|
||||
|
||||
COPY --from=server /docker4ssh/build/* .
|
||||
COPY --from=client /docker4ssh/build/docker4ssh .
|
||||
COPY --from=extra /docker4ssh/build/* .
|
||||
|
||||
ENTRYPOINT docker4ssh
|
11
examples/docker-compose.yml
Normal file
11
examples/docker-compose.yml
Normal file
@ -0,0 +1,11 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
docker4ssh:
|
||||
build: .
|
||||
ports:
|
||||
- "8642:8642"
|
||||
volumes:
|
||||
- "./docker4ssh.log.log:/docker4ssh/docker4ssh.log"
|
||||
restart: unless-stopped
|
||||
container_name: docker4ssh
|
14
examples/docker4ssh.service
Normal file
14
examples/docker4ssh.service
Normal file
@ -0,0 +1,14 @@
|
||||
[Unit]
|
||||
Description=
|
||||
After=network.target docker.service
|
||||
StartLimitBurst=3
|
||||
StartLimitIntervalSec=60
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/etc/docker4ssh
|
||||
ExecStart=/usr/bin/docker4ssh
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Reference in New Issue
Block a user