Created
July 30, 2020 14:10
-
-
Save Luttik/ec8aad6ce43a26d81081c6f9df758452 to your computer and use it in GitHub Desktop.
How I got pypiserver to run with google cloud storage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM python:latest | |
| COPY .htpasswd "/.htpasswd" | |
| RUN python3 -m pip install --upgrade pip | |
| RUN pip3 install pypiserver[passlib] | |
| RUN apt-get update | |
| RUN apt-get install lsb-release -y dos2unix | |
| RUN echo "deb http://packages.cloud.google.com/apt gcsfuse-buster main" | \ | |
| tee /etc/apt/sources.list.d/gcsfuse.list | |
| RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - | |
| RUN mkdir -p /data/packages | |
| RUN apt-get update | |
| RUN apt-get install gcsfuse -y | |
| COPY start.sh pypi-bucket-editor-credentials.json / | |
| ENV GOOGLE_APPLICATION_CREDENTIALS "/pypi-bucket-editor-credentials.json" | |
| RUN dos2unix /start.sh | |
| RUN chmod +x /start.sh | |
| ENTRYPOINT ["/start.sh"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| gcsfuse techonomy-pypi /data/packages | |
| python3 -m pypiserver -P /.htpasswd -a update,download,list /data/packages |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment