Skip to content

Commit

Permalink
Adding twine (#9)
Browse files Browse the repository at this point in the history
* run pypi gunicorn process with arguments, adds helper scripts to stage and push packages, almost fully working SSL

* typo

* removes gunicorn.conf.py

* bugfix

* adding twine

* removing errant file

---------

Co-authored-by: Brad Armstrong <barmstrong@microsoft.com>
  • Loading branch information
bigtallcampbell and Brad Armstrong authored Jul 23, 2024
1 parent 04402b0 commit 21604f8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
spacedev_cache
dependencies
12 changes: 6 additions & 6 deletions Dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@ RUN python -m pip install \
RUN python -m pip install \
--no-warn-script-location \
--prefix=/pypi-server \
.

RUN mkdir -p /code/pypiserver-${PYPI_SERVER_VERSION}/docker/data/packages
twine

COPY src/gunicorn.conf.py /code/pypiserver-${PYPI_SERVER_VERSION}/docker/data/gunicorn.conf.py
RUN python -m pip install \
--no-warn-script-location \
--prefix=/pypi-server \
.

FROM mcr.microsoft.com/cbl-mariner/base/python:3.9 as final
ARG OCI_REGISTRY_PORT=5000
Expand Down Expand Up @@ -84,12 +85,11 @@ COPY --from=downloader /htpasswd/libs/* /usr/lib/

# Copy the built pypi-server files
COPY --from=pypi_builder /pypi-server /pypi-server
COPY --from=pypi_builder /code/pypiserver-${PYPI_SERVER_VERSION}/docker/data /data
COPY --chmod=0755 src/entrypoint.sh /entrypoint.sh


VOLUME "/var/lib/registry"
VOLUME "/data/packages"
VOLUME "/data"
EXPOSE ${OCI_REGISTRY_PORT} ${PYPISERVER_PORT}

USER root
Expand Down
3 changes: 2 additions & 1 deletion src/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ if [[ "${PYPISERVER_ENABLED}" == "true" ]]; then
echo "PYPISERVER_ENABLED='true'. Starting the PyPiServer..."
# Run the pypi server in the background
mkdir -p /data/packages
/pypi-server/bin/pypi-server run -p ${PYPISERVER_PORT:-$PORT} --server gunicorn --backend cached-dir /data/packages --verbose --log-file /var/log/pypiserver.log &
export GUNICORN_CMD_ARGS="--accesslog - --errorlog - --preload --workers 1 --worker-class gevent"
/pypi-server/bin/pypi-server run -a . -P . -p ${PYPISERVER_PORT:-$PORT} --server gunicorn --backend cached-dir /data/packages --verbose --log-file /var/log/pypiserver.log &
PYPI_PID=$!
echo "...PyPiServer started."
fi
Expand Down
10 changes: 0 additions & 10 deletions src/gunicorn.conf.py

This file was deleted.

0 comments on commit 21604f8

Please sign in to comment.