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.

Revisions

  1. Luttik created this gist Jul 30, 2020.
    24 changes: 24 additions & 0 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    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"]
    3 changes: 3 additions & 0 deletions start.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    #!/bin/bash
    gcsfuse techonomy-pypi /data/packages
    python3 -m pypiserver -P /.htpasswd -a update,download,list /data/packages