Skip to content

Commit 7de2561

Browse files
committed
'dockerfile'
1 parent bf06b73 commit 7de2561

File tree

7 files changed

+39
-12
lines changed

7 files changed

+39
-12
lines changed

Dockerfile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM rackspacedot/python37
2+
LABEL MAINTAINER="xunhanliu<[email protected]>"
3+
# 修改时区、 pip>10 可以config 换源
4+
RUN echo "Asia/Shanghai" > /etc/timezone \
5+
&& pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple/ \
6+
&& python -m pip install --upgrade pip
7+
8+
9+
10+
RUN mkdir -p /usr/src/middleware
11+
12+
WORKDIR /usr/src
13+
14+
COPY es_sync .
15+
COPY run.py .
16+
17+
ADD requirements.txt /usr/src
18+
RUN pip install -r /usr/src/requirements.txt
19+
CMD ["python","run.py", "config.yaml"]
20+
# docker build 示例: docker build -t py-mysql-elasticsearch-sync:latest .

README_CN.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
docker部署需要挂载 middleware 目录,config.yaml binlog.info 文件
2+
3+
4+
5+
16
tips: 原始项目为: [原始项目](https://github.com/zhongbiaodev/py-mysql-elasticsearch-sync)
27

38
# py-mysql-elasticsearch-sync

binlog.info

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
log_file:
2+
log_pos:

es_sync/mian.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def encode_in_py2(s):
3232
from pymysqlreplication.row_event import DeleteRowsEvent, UpdateRowsEvent, WriteRowsEvent
3333
from pymysqlreplication.event import RotateEvent, XidEvent
3434

35-
__version__ = '0.4.2'
35+
__version__ = '0.5.0'
3636

3737

3838
# The magic spell for removing invalid characters in xml stream.

requirements.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
PyMySQL==0.6.7
2-
mysql-replication>=0.8
3-
requests>=2.9.1
4-
PyYAML>=3.11
5-
lxml>=3.5.0
1+
PyMySQL==1.0.2
2+
mysql-replication==0.30
3+
requests==2.26.0
4+
PyYAML==5.3
5+
lxml==4.5.0
66
future>=0.15.2 #for py2 compat

test.py renamed to run.py

File renamed without changes.

setup.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
author_email='[email protected]',
1212
description='MySQL to Elasticsearch sync tool',
1313
install_requires=[
14-
'PyMySQL==0.6.7',
15-
'mysql-replication==0.9',
16-
'requests==2.9.1',
17-
'PyYAML==3.11',
18-
'lxml==3.5.0',
19-
'future==0.15.2'
14+
'PyMySQL==1.0.2',
15+
'mysql-replication==0.30',
16+
'requests==2.26.0',
17+
'PyYAML==5.3',
18+
'lxml==4.5.0',
19+
'future==0.15.2',
2020
],
2121
entry_points={
2222
'console_scripts': [

0 commit comments

Comments
 (0)