Skip to content

Commit

Permalink
Фикс прав доступа у sshproxy
Browse files Browse the repository at this point in the history
  • Loading branch information
serdcebolit committed Feb 11, 2024
1 parent fc19840 commit 80e232d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,18 @@ jobs:
env:
DEPLOY_ENV_PATH: ${{ secrets.DOCKER_ENV_PATH }}
NEED_DEPLOY: ${{ env.NEED_DEPLOY }} # todo сделать переключатель для деплоя
SSH_MAIN_USER: ${{ secrets.SSH_MAIN_USER }}
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
script_stop: true
envs: DEPLOY_ENV_PATH,NEED_DEPLOY
envs: DEPLOY_ENV_PATH,NEED_DEPLOY,SSH_MAIN_USER
script: |
cd $DEPLOY_ENV_PATH
zsh sandbox stop
git reset --hard
git pull
zsh sandbox pull_proxy
zsh sandbox start
bash sandbox stop
git reset --hard
su $SSH_MAIN_USER -c 'git pull origin master'
bash sandbox pull_proxy
bash sandbox start
10 changes: 5 additions & 5 deletions sshproxy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ RUN yum update -y \
&& yum install -y wget python python-pip python-dev bash \
&& yum clean all

RUN wget https://github.com/nginx-proxy/docker-gen/releases/download/0.8.1/docker-gen-alpine-linux-amd64-0.8.1.tar.gz \
&& tar xvzf docker-gen-alpine-linux-amd64-0.8.1.tar.gz -C /usr/local/bin \
&& mkdir -p /usr/src/app/sshpiper_config \
&& chmod -R 700 /usr/src/app/sshpiper_config

RUN groupadd -g 600 bitrix \
&& useradd -g 600 -u 600 -p bitrix bitrix \
&& mkdir -p /tmp/ && chown -R bitrix:bitrix /tmp \
&& mkdir -p /etc/ssh \
&& touch /etc/ssh/ssh_host_rsa_key \
&& chown bitrix:bitrix /etc/ssh/ssh_host_rsa_key

RUN wget https://github.com/nginx-proxy/docker-gen/releases/download/0.8.1/docker-gen-alpine-linux-amd64-0.8.1.tar.gz \
&& tar xvzf docker-gen-alpine-linux-amd64-0.8.1.tar.gz -C /usr/local/bin \
&& mkdir -p /usr/src/app/sshpiper_config \
&& chown -R bitrix:bitrix /usr/src/app/sshpiper_config

ADD . /usr/src/app

ENV DOCKER_HOST unix:///var/run/docker.sock
Expand Down

0 comments on commit 80e232d

Please sign in to comment.