Implement kaya-rbcs: simplified RBCS clone on the Kaya framework
CI / Build and push docker image (push) Successful in 2m57s
CI / Build and push docker image (push) Successful in 2m57s
- KayaApp with GET/PUT recursive routes backed by memcached (aiomcache) - env-based configuration, metadata-aware value encoding, key prefix/digest - Granian RSGI launcher (rbcs-server / python -m kaya_rbcs) - pinned requirements via pip-compile, alpine:3.24 Dockerfile with healthcheck - offline tests using an in-process fake memcached - Gitea Actions workflow to build and push the multi-arch Docker image
This commit is contained in:
+37
@@ -0,0 +1,37 @@
|
||||
FROM alpine:3.24
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
PIP_DISABLE_PIP_VERSION_CHECK=1 \
|
||||
PIP_NO_CACHE_DIR=1 \
|
||||
RBCS_HOST=0.0.0.0 \
|
||||
RBCS_PORT=8080 \
|
||||
RBCS_MEMCACHE_HOST=memcached \
|
||||
RBCS_MEMCACHE_PORT=11211
|
||||
|
||||
RUN apk add --no-cache python3
|
||||
|
||||
WORKDIR /opt/kaya-rbcs
|
||||
|
||||
COPY requirements.txt ./
|
||||
RUN python3 -m venv /opt/venv \
|
||||
&& /opt/venv/bin/pip install -r requirements.txt
|
||||
|
||||
COPY pyproject.toml README.md ./
|
||||
COPY src ./src
|
||||
RUN /opt/venv/bin/pip install --no-deps .
|
||||
|
||||
RUN addgroup -S rbcs \
|
||||
&& adduser -S -G rbcs rbcs \
|
||||
&& chown -R rbcs:rbcs /opt/kaya-rbcs /opt/venv
|
||||
|
||||
ENV PATH="/opt/venv/bin:${PATH}"
|
||||
|
||||
USER rbcs
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
||||
CMD python3 -c "import socket, os; socket.create_connection(('127.0.0.1', int(os.environ['RBCS_PORT'])), timeout=3).close()"
|
||||
|
||||
ENTRYPOINT ["rbcs-server"]
|
||||
Reference in New Issue
Block a user