提交 6708c6d2 authored 作者: zw.wang's avatar zw.wang

pypiserver

上级 b53d4f5b
wen:$apr1$i3NuNBJ1$cDldYM4sBAcQVARidD.XG/
FROM alpine FROM suadminwen/python3-ubuntu
RUN echo "https://mirror.tuna.tsinghua.edu.cn/alpine/v3.4/main/" > /etc/apk/repositories
RUN apk update --no-cache \
&& apk add --no-cache python3 \
&& cd /usr/bin \
&& ln -sf pip3 pip \
&& mkdir -p /root/.pip \
&& echo -e '[global]\nindex_url = https://pypi.doubanio.com/simple' > /root/.pip/pip.conf \
&& pip install --upgrade --no-cache-dir pip
WORKDIR ~ WORKDIR /root/
RUN apk add supervisor \ COPY ./.pypipassword ./
&& pip install pypiserver COPY ./pypi_supervisord.conf ./
RUN apt-get install -y apache2-utils \
&& apt-get install -y supervisor
RUN pip install pypiserver passlib
RUN mv pypi_supervisord.conf /etc/supervisor/conf.d \
&& mkdir -p /root/packages \
&& mkdir -p /var/log/supervisor \
&& touch /var/log/supervisor/pypi.log
EXPOSE 31415 EXPOSE 31415
ENTRYPOINT ["pypi-server -p 31415"] ENTRYPOINT ["/usr/bin/supervisord"]
---
用户:wen
密码:123
---
## 修改用户和密码
``` bash
pip install pypiserver passlib
apt install -y apache2-utils
htpasswd -c .pypipassword $USER
# 输入密码即可
```
## docker-compose 构建
```
# 使用docker-compose
docker-compose up -d --build
# 停止服务并删除image
# docker-compose down --rmi all
```
version: "3" version: "3"
services: services:
pypi_server: pypiserver:
container_name: pypi_server_container container_name: pypiserver
image: pypi_server:latest image: pypiserver-image:latest
build:
context: .
ports: ports:
- 31415:31415 - 31415:31415
volumes: volumes:
- ~/packages:/root/packages
- /etc/localtime:/etc/localtime - /etc/localtime:/etc/localtime
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
nodaemon=true nodaemon=true
[program:pypi_server] [program:pypi_server]
command=/usr/bin/gunicorn -w 1 -b 0.0.0.0:8080 --pythonpath='/usr/lib/python3.5/dist-packages,/usr/python3/dist-packages,/usr/lib/python3.5' pypi-server command=pypi-server -P /root/.pypipassword -a list -p 31415
directory=/~/packages directory=/root/
user=root user=root
autostart=true autostart=true
autorestart=true autorestart=true
redirect_stderr=true redirect_stderr=true
stdout_logfile=/opt/supervisor/pypi_server.log stdout_logfile=/var/log/supervisor/pypi.log
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论