-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
54 additions
and
36 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,52 @@ | ||
FROM alpine | ||
FROM snakepacker/python:all as builder | ||
|
||
MAINTAINER Mosquito <me@mosquito.su> | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
libcurl-openssl1.0-dev \ | ||
libmysqlclient-dev \ | ||
libpq-dev \ | ||
libssl1.0-dev \ | ||
libxml2-dev \ | ||
libxslt1-dev \ | ||
libffi-dev | ||
|
||
RUN virtualenv -p python2.7 /usr/share/python/app | ||
|
||
RUN /usr/share/python/app/bin/pip install -U \ | ||
pypi-server[postgres] \ | ||
pypi-server[mysql] \ | ||
pypi-server[proxy] | ||
|
||
COPY docker-entrypoint.py /usr/share/python/app/bin/entrypoint.py | ||
|
||
RUN chmod a+x /usr/share/python/app/bin/entrypoint.py | ||
|
||
################################################################# | ||
FROM snakepacker/python:2.7 | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
libcurl3 \ | ||
libmysqlclient20 \ | ||
libpq5 \ | ||
libssl1.0.0 \ | ||
libxml2 \ | ||
libxslt1.1 \ | ||
libffi6 && \ | ||
apt-get clean && \ | ||
rm -fr /var/lib/apt/lists/* | ||
|
||
ENV ADDRESS=0.0.0.0 | ||
ENV PORT=80 | ||
ENV STORAGE=/usr/lib/pypi-server | ||
ENV PYPI_SERVER_SRC=/usr/local/src/pypi-server | ||
|
||
RUN apk add --no-cache \ | ||
libffi \ | ||
py-cparser \ | ||
py-curl \ | ||
py-lxml \ | ||
py-mysqldb \ | ||
py-openssl \ | ||
py-psycopg2 \ | ||
py-setuptools | ||
|
||
COPY ./ /tmp | ||
|
||
RUN set -ex && \ | ||
apk add --no-cache --virtual .build-deps \ | ||
gcc \ | ||
libffi-dev \ | ||
musl-dev \ | ||
py-pip \ | ||
python-dev \ | ||
&& \ | ||
pip --no-cache-dir install -U '/tmp' && \ | ||
apk del .build-deps | ||
|
||
VOLUME "/usr/lib/pypi-server" | ||
|
||
COPY docker-entrypoint.py /usr/local/bin/entrypoint.py | ||
RUN chmod a+x /usr/local/bin/entrypoint.py | ||
ENV STORAGE=/var/lib/pypi-server | ||
|
||
EXPOSE 80 | ||
|
||
ENTRYPOINT ["/usr/local/bin/entrypoint.py"] | ||
COPY --from=builder /usr/share/python/app /usr/share/python/app | ||
RUN ln -snf /usr/share/python/app/bin/entrypoint.py /usr/bin/ && \ | ||
ln -snf /usr/share/python/app/bin/pypi-server /usr/bin/ | ||
|
||
ENTRYPOINT /usr/bin/entrypoint.py | ||
VOLUME "/var/lib/pypi-server" |
This file contains 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
This file contains 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
This file contains 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