Sign inSign up

itsnix/gcpay

By itsnix

•Updated 11 months ago

uvicorn, python, starlette, javascript, htyml, css, react connected by unix domain socket

Image
Languages & frameworks
Developer tools
Web servers
0

1.9K

itsnix/gcpay repository overview

starlette with uvicorn - CMD ["/home/gcpay/.python/bin/uvicorn", "--workers", "9", "--proxy-headers", "--uds", "/tmp/gcpay.sock", "--loop", "uvloop", "--http", "httptools", "--interface", "asgi3", "--access-log", "--log-level", "trace", "--server-header", "--lifespan", "on", "app:app" ]

dockerfile

⁠FROM debian:unstable-20230814-slim

#debian:unstable-20240408-slim FROM debian:unstable-slim

ARG USERNAME=gcpay ARG USER_UID=101 ARG USER_GID=$USER_UID

⁠Create the user

RUN groupadd --system --gid $USER_GID $USERNAME
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME
# # [Optional] Add sudo support. Omit if you don't need to install software after connecting. && apt-get update
&& apt-get install -y sudo
&& echo $USERNAME ALL=(root) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME
&& chmod 0440 /etc/sudoers.d/$USERNAME
&& savedAptMark="$savedAptMark sudo"

RUN set -eux;
apt-get update && apt-get install -y --no-install-recommends
python3.13
libpython3.13-minimal
libpython3.13-stdlib
python3.13-minimal
libpython3.13-dev
sudo
git
python3.13-venv
libsodium-dev
libkrb5-dev
libsnappy-dev
build-essential
curl

USER $USERNAME

RUN set -eux;
/usr/bin/python3.13 -m venv /home/$USERNAME/.python;
. /home/$USERNAME/.python/bin/activate;
python -m pip install --upgrade pip setuptools wheel;
python -m pip install "motor[gssapi,aws,ocsp,snappy,srv,zstd,encryption]"

WORKDIR /app/

⁠RUN set -ex; \

⁠echo "change_me to update starlette_auth" ; \

⁠. /home/$USERNAME/.python/bin/activate; \

⁠git clone https://github.com/accent-starlette/starlette-auth.git⁠; \

⁠cd starlette-auth; \

⁠python -m pip install --upgrade -r requirements.txt; \

⁠cd ..

RUN set -ex;
echo "change_me to upgrade starlette... 0.46.0..";
git clone https://[snip]github.com/nixroxursox/starlette.git
&& git clone https://[snip]github.com/nixroxursox/starlette-context.git
&& cp -R starlette-context/starlette_context /app/starlette/
&& git clone https://[snip]github.com/nixroxursox/starsessions.git
&& cp -R starsessions/starsessions /app/starlette/
&& git clone https://[snip]github.com/nixroxursox/asgi-logger.git
&& cp -R asgi-logger/asgi_logger /app/starlette/
&& git clone https://[snip]github.com/nixroxursox/timing-asgi.git
&& cp -R timing-asgi/timing_asgi /app/starlette/
&& git clone https://[snip]github.com/nixroxursox/asgi-sessions.git
&& cp -R asgi-sessions/asgi_sessions /app/starlette/
&& rm -rf /app/starlette-context
&& rm -rf /app/starsessions
&& rm -rf /app/asgi-logger
&& rm -rf /app/timing-asgi
&& rm -rf /app/asgi-sessions;

COPY req*.txt /app/starlette/ COPY .bashrc /home/$USERNAME/ COPY starlette_paths.pth /home/$USERNAME/.python/lib64/python3.13/site-packages/ #COPY starsessions.tar.gz /app/starlette/

USER $USERNAME

RUN set -ex;
cd /app/starlette
&& . /home/$USERNAME/.python/bin/activate;
python -m pip install -r req1.txt;

RUN set -eux;
cd /app/starlette
&& . /home/$USERNAME/.python/bin/activate;
python -m pip install --upgrade uvicorn uvloop httptools asyncio;

RUN set -ex;
cd /app/starlette
&& . /home/$USERNAME/.python/bin/activate;
python -m pip install -r req2.txt;

RUN set -ex;
cd /app/starlette
&& . /home/$USERNAME/.python/bin/activate;
python -m pip install -r req3.txt;

RUN set -ex;
cd /app/starlette
&& . /home/$USERNAME/.python/bin/activate;
python -m pip install -r req4.txt;

RUN set -ex;
cd /app/starlette
&& . /home/$USERNAME/.python/bin/activate;
python -m pip install -r req5.txt;

⁠RUN set -eux; \

⁠sudo apt-get update

⁠RUN set -ex; \

⁠cd /app/starlette \

⁠&& . /home/$USERNAME/.python/bin/activate; \

⁠python -m pip install -r newreq.txt;

WORKDIR /app/website

CMD ["/home/gcpay/.python/bin/uvicorn", "--workers", "9", "--proxy-headers", "--uds", "/tmp/gcpay.sock", "--loop", "uvloop", "--http", "httptools", "--interface", "asgi3", "--access-log", "--log-level", "trace", "--server-header", "--lifespan", "on", "app:app" ]

Tag summary

Content type

Image

Digest

sha256:ffe3913f1…

Size

1.1 GB

Last updated

11 months ago

docker pull itsnix/gcpay