Skip to content

Commit

Permalink
dynamic URI CALLBACK?
Browse files Browse the repository at this point in the history
  • Loading branch information
parhamrahmani committed May 28, 2024
1 parent e109e11 commit 840a732
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
4 changes: 3 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@
def get_ip():
response = urllib.request.urlopen('http://ipinfo.io/json')
data = json.load(response)
print(data['ip'])
return data['ip']


REDIRECT_URI_REMOTE = f'http://{get_ip()}:5000/callback'
REDIRECT_URI_REMOTE = f'http://{get_ip()}/callback'
REDIRECT_URI = REDIRECT_URI_REMOTE if ENVIRONMENT == 'production' else REDIRECT_URI_LOCAL


Expand Down Expand Up @@ -347,4 +348,5 @@ def svg_display():


if __name__ == '__main__':
get_ip()
app.run(debug=True)
29 changes: 25 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,39 @@
version: '3.8'

services:
infra-test:
build:
context: .
dockerfile: flask.Dockerfile
ports:
- "5000:5000"
environment:
FLASK_KEY: ${FLASK_KEY}
SPOTIFY_CLIENT_ID: ${SPOTIFY_CLIENT_ID}
SPOTIFY_SECRET_ID: ${SPOTIFY_SECRET_ID}
ENVIRONMENT: ${ENVIRONMENT}
MYSQL_ROOT_PASSWORD: ${ROOT_DB_PASSWORD}
MYSQL_DATABASE: ${DB_NAME}
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASSWORD}
EC2_dbs_IP: ${EC2_dbs_IP}
depends_on:
- database

database:
build:
context: .
dockerfile: database.Dockerfile
ports:
- "3306:3306"
environment:
- MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
- MYSQL_DATABASE: ${MYSQL_DATABASE}
- MYSQL_USER: ${MYSQL_USER}
- MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_ROOT_PASSWORD: ${ROOT_DB_PASSWORD}
MYSQL_DATABASE: ${DB_NAME}
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASSWORD}
networks:
- app-network

networks:
app-network:
driver: bridge

0 comments on commit 840a732

Please sign in to comment.