Loading Dockerfile +14 −8 Original line number Diff line number Diff line FROM alpine:3.9 FROM python:3-alpine3.9 COPY app/ /usr/share/ RUN chmod 555 /usr/share/main.py \ && apk add --no-cache python3 openssl \ && apk add --no-cache --virtual build-deps build-base python3-dev libffi-dev openssl-dev \ && pip3 install -r /usr/share/requirements.txt \ WORKDIR /usr/src/app # TODO: create new user COPY app/requirements.txt . RUN apk add --no-cache openssl \ && apk add --no-cache --virtual build-deps build-base libffi-dev openssl-dev \ && pip install --upgrade pip \ && pip install --no-cache-dir -r requirements.txt \ && apk del build-deps USER 9000 ENTRYPOINT ["python3", "/usr/share/main.py"] COPY app/ . CMD [ "python3", "./main.py" ] No newline at end of file app/main.py +7 −1 Original line number Diff line number Diff line Loading @@ -7,6 +7,13 @@ import paramiko import requests from requests.auth import HTTPBasicAuth import os import logging import sys ch = logging.StreamHandler(sys.stdout) ch.setLevel(logging.DEBUG) logger = logging.getLogger('create-account').addHandler(ch) paramiko.util.get_logger("paramiko").addHandler(ch) HOST_NAME = '0.0.0.0' PORT_NUMBER = 9000 Loading @@ -19,7 +26,6 @@ class MyHandler(BaseHTTPRequestHandler): postvars = urllib.parse.parse_qs(self.rfile.read(length)) postvars = {k.decode(): v[0].decode() for k, v in postvars.items()} self.respond(100, 'test') self.create_account(postvars['target_email'], postvars['password'], postvars['password_confirm'], postvars['displayname'], postvars['email_quota'], postvars['fallback_email'], postvars['nextcloud_quota']) Loading Loading
Dockerfile +14 −8 Original line number Diff line number Diff line FROM alpine:3.9 FROM python:3-alpine3.9 COPY app/ /usr/share/ RUN chmod 555 /usr/share/main.py \ && apk add --no-cache python3 openssl \ && apk add --no-cache --virtual build-deps build-base python3-dev libffi-dev openssl-dev \ && pip3 install -r /usr/share/requirements.txt \ WORKDIR /usr/src/app # TODO: create new user COPY app/requirements.txt . RUN apk add --no-cache openssl \ && apk add --no-cache --virtual build-deps build-base libffi-dev openssl-dev \ && pip install --upgrade pip \ && pip install --no-cache-dir -r requirements.txt \ && apk del build-deps USER 9000 ENTRYPOINT ["python3", "/usr/share/main.py"] COPY app/ . CMD [ "python3", "./main.py" ] No newline at end of file
app/main.py +7 −1 Original line number Diff line number Diff line Loading @@ -7,6 +7,13 @@ import paramiko import requests from requests.auth import HTTPBasicAuth import os import logging import sys ch = logging.StreamHandler(sys.stdout) ch.setLevel(logging.DEBUG) logger = logging.getLogger('create-account').addHandler(ch) paramiko.util.get_logger("paramiko").addHandler(ch) HOST_NAME = '0.0.0.0' PORT_NUMBER = 9000 Loading @@ -19,7 +26,6 @@ class MyHandler(BaseHTTPRequestHandler): postvars = urllib.parse.parse_qs(self.rfile.read(length)) postvars = {k.decode(): v[0].decode() for k, v in postvars.items()} self.respond(100, 'test') self.create_account(postvars['target_email'], postvars['password'], postvars['password_confirm'], postvars['displayname'], postvars['email_quota'], postvars['fallback_email'], postvars['nextcloud_quota']) Loading