-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from CaKrome/switch_to_docker_compose
Switch to docker compose
- Loading branch information
Showing
9 changed files
with
75 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
FROM quay.io/almalinux/almalinux:9 AS compile-image | ||
|
||
ENV SHADOWSOCKS_VER=1.19.2 | ||
ENV V2RAY_PLUGIN_VER=1.3.2 | ||
|
||
WORKDIR /root | ||
|
||
RUN set -ex && dnf upgrade -y && dnf install -y binutils wget make gcc xz | ||
|
||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
|
||
RUN wget https://github.com/shadowsocks/shadowsocks-rust/archive/refs/tags/v${SHADOWSOCKS_VER}.tar.gz | ||
RUN tar -xf v${SHADOWSOCKS_VER}.tar.gz | ||
|
||
RUN set -ex \ | ||
&& source "$HOME/.cargo/env" \ | ||
&& cd shadowsocks-rust-${SHADOWSOCKS_VER} \ | ||
&& TARGET=release make build | ||
|
||
RUN strip /root/shadowsocks-rust-${SHADOWSOCKS_VER}/target/release/sslocal | ||
RUN strip /root/shadowsocks-rust-${SHADOWSOCKS_VER}/target/release/ssmanager | ||
RUN strip /root/shadowsocks-rust-${SHADOWSOCKS_VER}/target/release/ssserver | ||
RUN strip /root/shadowsocks-rust-${SHADOWSOCKS_VER}/target/release/ssservice | ||
RUN strip /root/shadowsocks-rust-${SHADOWSOCKS_VER}/target/release/ssurl | ||
|
||
RUN mv /root/shadowsocks-rust-${SHADOWSOCKS_VER}/target/release/sslocal /root/ | ||
RUN mv /root/shadowsocks-rust-${SHADOWSOCKS_VER}/target/release/ssmanager /root/ | ||
RUN mv /root/shadowsocks-rust-${SHADOWSOCKS_VER}/target/release/ssserver /root/ | ||
RUN mv /root/shadowsocks-rust-${SHADOWSOCKS_VER}/target/release/ssservice /root/ | ||
RUN mv /root/shadowsocks-rust-${SHADOWSOCKS_VER}/target/release/ssurl /root/ | ||
|
||
FROM quay.io/almalinux/almalinux:9 AS runtime-image | ||
|
||
RUN set -ex && dnf upgrade -y && dnf clean all | ||
|
||
RUN useradd --create-home serviceuser | ||
|
||
WORKDIR /home/serviceuser | ||
|
||
USER serviceuser | ||
|
||
COPY server_block_local.acl . | ||
COPY --from=compile-image /root/sslocal /usr/local/bin/ | ||
COPY --from=compile-image /root/ssmanager /usr/local/bin/ | ||
COPY --from=compile-image /root/ssserver /usr/local/bin/ | ||
COPY --from=compile-image /root/ssservice /usr/local/bin/ | ||
COPY --from=compile-image /root/ssurl /usr/local/bin/ | ||
|
||
ENV TZ=America/Toronto | ||
|
||
CMD [ "ssservice", "server", "-c", "/etc/shadowsocks-rust/config.json", "--acl", "server_block_local.acl" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,16 @@ | ||
# shadowsocks-rust-docker | ||
Docker/Podman deployment solution of [shadowsocks-rust](https://github.com/shadowsocks/shadowsocks-rust) | ||
Docker deployment solution of [shadowsocks-rust](https://github.com/shadowsocks/shadowsocks-rust) | ||
|
||
# Usage | ||
|
||
```bash | ||
git clone https://github.com/CaKrome/shadowsocks-rust-docker.git | ||
|
||
#If your server is using amd64 architecture | ||
cd shadowsocks-rust-docker/amd64 | ||
# Build the docker image | ||
docker compose build | ||
|
||
#If your server is using arm64 architecture | ||
cd shadowsocks-rust-docker/arm64 | ||
# Now edit the file config.json to the configuation you like and also port in docker-compose.yml if you changed the default port. | ||
|
||
#Build the docker image | ||
docker build . -t cakrome/ss-rust | ||
|
||
#Now create a file called config.json in /etc/shadowsocks-rust and put your configuration there, we have a sample configuation file(sample_conf.json) for reference | ||
|
||
#Run the built docker image | ||
docker run -d -p [port]:[port] -p [port]:[port]/udp --name ss-rust --restart=always -v /etc/shadowsocks-rust:/etc/shadowsocks-rust cakrome/ss-rust | ||
# Bring the service up | ||
docker compose up -d | ||
``` | ||
When using podman, replace `docker` with `podman` | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,4 @@ | |
"timeout":300, | ||
"method":"aes-256-gcm", | ||
"mode":"tcp_and_udp" | ||
"fast_open":true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
services: | ||
shadowsocks-rust: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
container_name: ss-rust | ||
ports: | ||
- "8388:8388/tcp" | ||
- "8388:8388/udp" | ||
volumes: | ||
- type: bind | ||
source: ./config.json | ||
target: /etc/shadowsocks-rust/config.json | ||
restart: unless-stopped |
File renamed without changes.