Skip to content

Commit a581d22

Browse files
andriibiloussigmastrazhnyk
authored andcommitted
docker fix
1 parent 230c472 commit a581d22

File tree

10 files changed

+242
-141
lines changed

10 files changed

+242
-141
lines changed

.env renamed to .env_example

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
# Configuration file for the example
22
##
33
# Integration key is the same as client ID
4-
DS_CLIENT_ID=95157842-624a-4cba-8c73-59004b270417
4+
DS_CLIENT_ID={DS_CLIENT_ID}
55
# Integration secret key
6-
DS_CLIENT_SECRET=f9c17b5c-973e-4f31-acf3-1dec7222170e
6+
DS_CLIENT_SECRET={DS_CLIENT_SECRET}
77

88
# API Username
9-
DS_IMPERSONATED_USER_GUID=8a1318df-e2d3-48af-ae26-27fa85fe80e9
9+
DS_IMPERSONATED_USER_GUID={DS_USER_GUID}
1010

1111
# Target account ID. Use FALSE to indicate that the user's default account should be used.
1212
DS_TARGET_ACCOUNT_ID=FALSE
1313

14-
PAYMENT_GATEWAY_ACCOUNT_ID=8e0c89fd-ff6f-4bbf-98fc-95e10596e120
15-
PAYMENT_GATEWAY_NAME=Stripe_3758
16-
PAYMENT_GATEWAY_DISPLAY_NAME=Stripe_3758
14+
DS_PAYMENT_GATEWAY_ID={DS_PAYMENT_GATEWAY_ID}
15+
DS_PAYMENT_GATEWAY_NAME={DS_PAYMENT_GATEWAY_NAME}
16+
DS_PAYMENT_GATEWAY_DISPLAY_NAME={DS_PAYMENT_GATEWAY_DISPLAY_NAME}
1717

1818
# Private key string - source or path, for instance: /home/user/app/id_rsa
1919
# NOTE: the Python config file parser requires that you
2020
# add a space at the beginning of the second and
2121
# subsequent lines of the multiline key value:
22-
DS_PRIVATE_KEY=./app/private.key
22+
DS_PRIVATE_KEY={RSA_KEY}
2323

2424
# React environment variables
2525
# UI and BE links
26-
REACT_APP_DS_RETURN_URL=http://localhost
27-
REACT_APP_API_BASE_URL=http://localhost/api
26+
REACT_APP_DS_RETURN_URL=http://localhost:3000
27+
REACT_APP_API_BASE_URL=http://localhost:5001/api
2828

2929
# The DS Authentication server
3030
DS_AUTH_SERVER=https://account-d.docusign.com

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
*.pyc
22
.idea
3-
*.env*
43

4+
.env
55
__pycache__/
66

77
# pyenv

client/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ ENV REACT_APP_API_BASE_URL=$REACT_APP_API_BASE_URL
55

66
WORKDIR /app
77
COPY .env ./
8-
COPY ./package.json ./yarn.lock ./
8+
COPY ./client/package.json ./client/yarn.lock ./
99
RUN npm install
1010

11-
COPY . .
11+
COPY ./client/ .
1212

1313
RUN npm run build
1414

1515
# Run stage
1616
FROM --platform=linux/amd64 nginx:1.23-alpine
1717
COPY --from=base /app/build /var/www/app
18-
COPY ./nginx/conf/ /etc/nginx/conf.d
18+
COPY ./client/nginx/conf/ /etc/nginx/conf.d
1919
EXPOSE 80 443

client/src/api/auth.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export async function getStatus(setStatus, setAuthType) {
6464
}
6565

6666
export async function jwtAuth(navigate) {
67+
console.log('process.env',process.env)
6768
try {
6869
await axios.get(
6970
process.env.REACT_APP_API_BASE_URL + "/jwt_auth",

docker-compose.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ services:
44
image: myuni/front:latest
55
restart: always
66
build:
7-
context: ./client/
8-
dockerfile: Dockerfile
7+
context: .
8+
dockerfile: ./client/Dockerfile
99
args:
1010
REACT_APP_API_BASE_URL: "http://localhost/api"
1111
env_file:
@@ -18,7 +18,7 @@ services:
1818
image: myuni/back:latest
1919
restart: always
2020
build:
21-
context: ./server/
22-
dockerfile: Dockerfile
21+
context: .
22+
dockerfile: ./server/Dockerfile
2323
env_file:
2424
- .env

server/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
FROM python:3.9-slim
1+
FROM --platform=linux/amd64 python:3.9-slim
22

33
WORKDIR /app
44

5-
COPY requirements.txt ./
5+
COPY ./server/requirements.txt ./
66
COPY .env ./
77
RUN pip install --no-cache-dir -r requirements.txt
88

9-
COPY . .
9+
COPY ./server/ .
1010

1111
EXPOSE 5001
1212

13-
CMD ["flask", "run", "--host", "0.0.0.0", "--port", "5001"]
13+
CMD ["flask","run", "--host", "0.0.0.0", "--port", "5001"]

server/app/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
from flask import Flask
22
from flask_cors import CORS
33
from dotenv import load_dotenv
4+
import os
45

56
from app.api import auth, clickwrap, requests, common
67

78
load_dotenv()
89

910
URL_PREFIX = '/api'
11+
print(os.environ)
12+
print('=====')
1013

1114
app = Flask(__name__)
1215
app.config.from_pyfile("config.py")

server/app/api/auth.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ def jwt_auth():
5353
"""
5454
Authorization by JWT
5555
"""
56+
57+
print("INSIDE /api/jwt_auth !!!")
58+
# print("Request Headers:", dict(request.headers))
59+
# print("Request Args:", request.args)
60+
5661
try:
5762
auth_data = DsClient.update_token()
5863
except ApiException as exc:

0 commit comments

Comments
 (0)