Skip to content

Commit 9289738

Browse files
author
Jalin
committed
增加 docker 支持
1 parent 7361959 commit 9289738

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ venv
44
__pycache__
55
config.toml
66
*.ip.txt
7-
data/dumped/*
7+
data/dumped/*
8+
docker-compose.yml

Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM python:3.6.6-slim
2+
3+
MAINTAINER <pjialin admin@pjialin.com>
4+
ENV TZ Asia/Shanghai
5+
6+
WORKDIR /code
7+
8+
COPY requirements.txt .
9+
10+
RUN apt-get update \
11+
&& apt-get install -y --no-install-recommends gcc python-dev \
12+
&& rm -rf /var/lib/apt/lists/* \
13+
&& pip install --no-cache-dir -r requirements.txt \
14+
&& apt-get purge -y --auto-remove gcc python-dev
15+
16+
VOLUME /code/data
17+
18+
COPY . .
19+
COPY config.toml.example config.toml
20+
21+
CMD [ "python", "main.py"]

docker-compose.yml.example

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: "3.4"
2+
3+
services:
4+
pyproxy:
5+
build: .
6+
volumes:
7+
- ./config.toml:/code/config.toml
8+
- pyproxy-data:/data
9+
ports:
10+
- 8080:8080
11+
12+
volumes:
13+
pyproxy-data:

0 commit comments

Comments
 (0)