init
This commit is contained in:
parent
0e53281e5b
commit
3d77c70ba3
|
@ -0,0 +1 @@
|
|||
docker/
|
|
@ -138,3 +138,5 @@ dmypy.json
|
|||
# Cython debug symbols
|
||||
cython_debug/
|
||||
|
||||
.vscode/
|
||||
.history/
|
|
@ -0,0 +1,13 @@
|
|||
FROM python:3-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt /app/requirements.txt
|
||||
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
COPY . /app
|
||||
|
||||
EXPOSE 7000
|
||||
|
||||
CMD ["python", "main.py"]
|
|
@ -0,0 +1,14 @@
|
|||
version: "3"
|
||||
services:
|
||||
sbpgs_server:
|
||||
image: "hub.docker.talentkita.dev/sbgps_server:latest"
|
||||
restart: "always"
|
||||
volumes:
|
||||
- ./logs:/app/logs
|
||||
ports:
|
||||
- "7000:7000"
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "10"
|
|
@ -0,0 +1,29 @@
|
|||
import sys
|
||||
from twisted.internet.protocol import (
|
||||
Factory,
|
||||
Protocol
|
||||
)
|
||||
from twisted.internet.endpoints import TCP4ServerEndpoint
|
||||
from twisted.internet import reactor
|
||||
from twisted.python import log
|
||||
from twisted.python.logfile import DailyLogFile
|
||||
|
||||
|
||||
class Meitrack(Protocol):
|
||||
def dataReceived(self, data):
|
||||
log.msg(data)
|
||||
|
||||
|
||||
class MeitrackFactory(Factory):
|
||||
protocol = Meitrack
|
||||
|
||||
|
||||
def main():
|
||||
log.startLogging(DailyLogFile.fromFullPath('./logs/meitrack.log'))
|
||||
endpoint = TCP4ServerEndpoint(reactor, 7000)
|
||||
endpoint.listen(MeitrackFactory())
|
||||
reactor.run()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
|
@ -0,0 +1,11 @@
|
|||
attrs==21.4.0
|
||||
Automat==20.2.0
|
||||
constantly==15.1.0
|
||||
hyperlink==21.0.0
|
||||
idna==3.3
|
||||
incremental==21.3.0
|
||||
six==1.16.0
|
||||
Twisted==22.2.0
|
||||
# twisted-iocpsupport==1.0.2 # needed only on windows mechine
|
||||
typing-extensions==4.1.1
|
||||
zope.interface==5.4.0
|
Loading…
Reference in New Issue