+ supervisor, python and uvicorn in workspace74 (partially commit - no fully worked solution)

This commit is contained in:
qemu-test
2024-11-25 09:18:19 +03:00
parent f3b9303754
commit 3cb9b6e925
7 changed files with 118 additions and 36 deletions

View File

@ -1,30 +0,0 @@
#! /bin/bash
# Colors used for status updates
ESC_SEQ="\x1b["
COL_RESET=$ESC_SEQ"39;49;00m"
COL_RED=$ESC_SEQ"31;01m"
COL_GREEN=$ESC_SEQ"32;01m"
COL_YELLOW=$ESC_SEQ"33;01m"
COL_BLUE=$ESC_SEQ"34;01m"
COL_MAGENTA=$ESC_SEQ"35;01m"
COL_CYAN=$ESC_SEQ"36;01m"
# Detect which `ls` flavor is in use
if ls --color > /dev/null 2>&1; then # GNU `ls`
colorflag="--color"
export LS_COLORS='no=00:fi=00:di=01;31:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:'
else # macOS `ls`
colorflag="-G"
export LSCOLORS='BxBxhxDxfxhxhxhxhxcxcx'
fi
# Always use color output for `ls`
alias ls="command ls ${colorflag}"
alias gst='git status'
alias ga='git add'
alias gc='git commit -m'
alias gush='git push'
alias gull='git pull'
alias gb='git branch'

View File

@ -71,17 +71,72 @@ RUN composer self-update # Need for correctly update to actual old branch
RUN composer self-update --${COMPOSER_VERSION}
###########################################################################
# Laradock Aliases
# YADM
###########################################################################
USER root
SHELL ["/bin/bash", "-c"]
# once please
RUN apt update
RUN apt install -y direnv yadm
RUN curl -sS https://starship.rs/install.sh | sh -s -- -f
USER laradock
COPY ./aliases.sh /home/laradock/aliases.sh
RUN yadm clone --bootstrap https://vcs.wpstudio.ru/gitea/dotfiles.git
RUN echo "" >> ~/.bashrc && \
echo "# Load Custom Aliases" >> ~/.bashrc && \
echo "source ~/aliases.sh" >> ~/.bashrc && \
echo "" >> ~/.bashrc
RUN sed -i 's/#/\\$/g' ${HOME}/.config/starship.toml
###########################################################################
# SUPERVISOR:
###########################################################################
USER root
ARG INSTALL_SUPERVISOR=false
RUN if [ ${INSTALL_SUPERVISOR} = true ]; then \
apt install -y supervisor \
;fi
RUN apt install -y liblzma-dev libbz2-dev libffi-dev libreadline-dev
USER laradock
RUN curl https://pyenv.run | bash
RUN echo '' >> ~/.shell-env.local && \
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.shell-env.local && \
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.shell-env.local && \
echo 'eval "$(pyenv init -)"' >> ~/.shell-env.local && \
echo '' >> ~/.shell-env.local && \
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.shell-env.local && \
echo '' >> ~/.shell-env.local
RUN $HOME/.pyenv/bin/pyenv install 3.9
ARG INSTALL_PYTHON=false
RUN if [ ${INSTALL_PYTHON} = true ]; then \
export PYENV_VERSION=3.9 && \
python -m pip install uvicorn \
;fi
RUN if [ false = true ]; then \
export PYENV_VERSION=3.9 && \
python -m pip install uvicorn && \
python -m pip install --upgrade supervisor && \
echo_supervisord_conf > /etc/supervisord.conf && \
sed -i 's/\;\[include\]/\[include\]/g' /etc/supervisord.conf && \
sed -i 's/\;files\s.*/files = supervisord.d\/*.conf/g' /etc/supervisord.conf \
;fi
USER root
RUN apt install -y htop
###########################################################################
# Tune opts:
@ -104,6 +159,13 @@ RUN sed -i "s/^memory_limit = .*/memory_limit = $PHP_OPT_MEMORY_LIMIT/g" /etc/ph
USER root
# Clean up
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY ./crontab /etc/cron.d
RUN chmod -R 644 /etc/cron.d
#ENTRYPOINT ["/bin/bash","-c","service supervisor start"]