Skip to content

Instantly share code, notes, and snippets.

@Luttik
Created July 30, 2020 14:10
Show Gist options
  • Select an option

  • Save Luttik/ec8aad6ce43a26d81081c6f9df758452 to your computer and use it in GitHub Desktop.

Select an option

Save Luttik/ec8aad6ce43a26d81081c6f9df758452 to your computer and use it in GitHub Desktop.
How I got pypiserver to run with google cloud storage
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"]
#!/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