Miguel Diaz commited on
Commit
8ac41e5
·
1 Parent(s): 9bde4ab

fix: version and clean code

Browse files
Files changed (2) hide show
  1. Dockerfile +0 -2
  2. main.py +1 -1
Dockerfile CHANGED
@@ -1,7 +1,6 @@
1
  FROM python:3.9
2
 
3
  WORKDIR /code
4
- ARG now
5
  COPY ./requirements.txt /code/requirements.txt
6
 
7
 
@@ -17,7 +16,6 @@ WORKDIR $HOME/app
17
 
18
  COPY --chown=user . $HOME/app
19
  RUN pip install --user --no-cache-dir --upgrade -r /code/requirements.txt
20
- ENV build_date=$now
21
  #CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
22
  CMD ["hypercorn", "main:app", "--bind", "0.0.0.0:7860"]
23
 
 
1
  FROM python:3.9
2
 
3
  WORKDIR /code
 
4
  COPY ./requirements.txt /code/requirements.txt
5
 
6
 
 
16
 
17
  COPY --chown=user . $HOME/app
18
  RUN pip install --user --no-cache-dir --upgrade -r /code/requirements.txt
 
19
  #CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
20
  CMD ["hypercorn", "main:app", "--bind", "0.0.0.0:7860"]
21
 
main.py CHANGED
@@ -28,7 +28,7 @@ fecha_unix = str(int(time.time()))
28
  JWT_SECRET = users["master"]
29
  JWT_ALGORITHM = "HS256"
30
  JWT_EXPIRATION_TIME_MINUTES = 30
31
- print("Date:", os.environ.get("build_date", "Not found"))
32
  def create_jwt_token(data):
33
  to_encode = {"data": data}
34
  expire = datetime.utcnow() + timedelta(minutes=JWT_EXPIRATION_TIME_MINUTES)
 
28
  JWT_SECRET = users["master"]
29
  JWT_ALGORITHM = "HS256"
30
  JWT_EXPIRATION_TIME_MINUTES = 30
31
+
32
  def create_jwt_token(data):
33
  to_encode = {"data": data}
34
  expire = datetime.utcnow() + timedelta(minutes=JWT_EXPIRATION_TIME_MINUTES)