[{"data":1,"prerenderedAt":1838},["ShallowReactive",2],{"\u002Fdeploy\u002Fflask-plus-docker-production-setup-complete-guide":3},{"id":4,"title":5,"body":6,"description":1828,"extension":1829,"meta":1830,"navigation":54,"path":1834,"seo":1835,"stem":1836,"__hash__":1837},"content\u002Fdeploy\u002Fflask-plus-docker-production-setup-complete-guide.md","Flask + Docker Production Setup (Complete Guide)",{"type":7,"value":8,"toc":1791},"minimark",[9,13,17,22,25,33,135,141,183,187,275,279,292,301,305,308,311,315,319,326,329,367,374,390,393,418,422,428,450,453,457,460,547,554,558,563,606,613,617,620,626,648,651,719,726,730,747,750,754,805,814,818,821,836,839,849,852,872,876,879,882,943,946,1023,1026,1030,1033,1036,1102,1105,1134,1141,1145,1148,1201,1204,1216,1219,1223,1226,1229,1255,1258,1262,1265,1281,1284,1303,1307,1310,1317,1321,1402,1406,1408,1420,1423,1439,1442,1460,1463,1485,1488,1503,1506,1522,1525,1535,1538,1562,1565,1589,1592,1618,1621,1630,1633,1637,1706,1713,1717,1735,1739,1743,1746,1750,1753,1757,1766,1770,1773,1777,1780,1784,1787],[10,11,5],"h1",{"id":12},"flask-docker-production-setup-complete-guide",[14,15,16],"p",{},"If you're trying to run Flask in production with Docker, this guide shows you how to build, configure, and start the app step-by-step. It covers a minimal production-safe container setup, Gunicorn process configuration, environment handling, persistent storage decisions, and Nginx reverse proxy support.",[18,19,21],"h2",{"id":20},"quick-fix-quick-setup","Quick Fix \u002F Quick Setup",[14,23,24],{},"Use this minimal production-style setup first.",[26,27,29],"h3",{"id":28},"dockerfile",[30,31,32],"code",{},"Dockerfile",[34,35,39],"pre",{"className":36,"code":37,"language":28,"meta":38,"style":38},"language-dockerfile shiki shiki-themes github-light github-dark","FROM python:3.12-slim\n\nENV PYTHONDONTWRITEBYTECODE=1 \\\n    PYTHONUNBUFFERED=1\n\nWORKDIR \u002Fapp\n\nRUN apt-get update && apt-get install -y --no-install-recommends build-essential && rm -rf \u002Fvar\u002Flib\u002Fapt\u002Flists\u002F*\n\nCOPY requirements.txt .\nRUN pip install --no-cache-dir -r requirements.txt\n\nCOPY . .\n\nEXPOSE 8000\nCMD [\"gunicorn\", \"wsgi:app\", \"--bind\", \"0.0.0.0:8000\", \"--workers\", \"3\"]\n","",[30,40,41,49,56,62,68,73,79,84,90,95,101,107,112,118,123,129],{"__ignoreMap":38},[42,43,46],"span",{"class":44,"line":45},"line",1,[42,47,48],{},"FROM python:3.12-slim\n",[42,50,52],{"class":44,"line":51},2,[42,53,55],{"emptyLinePlaceholder":54},true,"\n",[42,57,59],{"class":44,"line":58},3,[42,60,61],{},"ENV PYTHONDONTWRITEBYTECODE=1 \\\n",[42,63,65],{"class":44,"line":64},4,[42,66,67],{},"    PYTHONUNBUFFERED=1\n",[42,69,71],{"class":44,"line":70},5,[42,72,55],{"emptyLinePlaceholder":54},[42,74,76],{"class":44,"line":75},6,[42,77,78],{},"WORKDIR \u002Fapp\n",[42,80,82],{"class":44,"line":81},7,[42,83,55],{"emptyLinePlaceholder":54},[42,85,87],{"class":44,"line":86},8,[42,88,89],{},"RUN apt-get update && apt-get install -y --no-install-recommends build-essential && rm -rf \u002Fvar\u002Flib\u002Fapt\u002Flists\u002F*\n",[42,91,93],{"class":44,"line":92},9,[42,94,55],{"emptyLinePlaceholder":54},[42,96,98],{"class":44,"line":97},10,[42,99,100],{},"COPY requirements.txt .\n",[42,102,104],{"class":44,"line":103},11,[42,105,106],{},"RUN pip install --no-cache-dir -r requirements.txt\n",[42,108,110],{"class":44,"line":109},12,[42,111,55],{"emptyLinePlaceholder":54},[42,113,115],{"class":44,"line":114},13,[42,116,117],{},"COPY . .\n",[42,119,121],{"class":44,"line":120},14,[42,122,55],{"emptyLinePlaceholder":54},[42,124,126],{"class":44,"line":125},15,[42,127,128],{},"EXPOSE 8000\n",[42,130,132],{"class":44,"line":131},16,[42,133,134],{},"CMD [\"gunicorn\", \"wsgi:app\", \"--bind\", \"0.0.0.0:8000\", \"--workers\", \"3\"]\n",[26,136,138],{"id":137},"dockerignore",[30,139,140],{},".dockerignore",[34,142,146],{"className":143,"code":144,"language":145,"meta":38,"style":38},"language-gitignore shiki shiki-themes github-light github-dark","__pycache__\u002F\n*.pyc\n*.pyo\n*.pyd\nvenv\u002F\n.env\n.git\n","gitignore",[30,147,148,153,158,163,168,173,178],{"__ignoreMap":38},[42,149,150],{"class":44,"line":45},[42,151,152],{},"__pycache__\u002F\n",[42,154,155],{"class":44,"line":51},[42,156,157],{},"*.pyc\n",[42,159,160],{"class":44,"line":58},[42,161,162],{},"*.pyo\n",[42,164,165],{"class":44,"line":64},[42,166,167],{},"*.pyd\n",[42,169,170],{"class":44,"line":70},[42,171,172],{},"venv\u002F\n",[42,174,175],{"class":44,"line":75},[42,176,177],{},".env\n",[42,179,180],{"class":44,"line":81},[42,181,182],{},".git\n",[26,184,186],{"id":185},"build-and-run","Build and run",[34,188,192],{"className":189,"code":190,"language":191,"meta":38,"style":38},"language-bash shiki shiki-themes github-light github-dark","docker build -t flask-app .\n\ndocker run -d \\\n  --name flask-app \\\n  --restart unless-stopped \\\n  -p 8000:8000 \\\n  --env-file .env \\\n  flask-app\n","bash",[30,193,194,214,218,231,240,250,260,270],{"__ignoreMap":38},[42,195,196,200,204,208,211],{"class":44,"line":45},[42,197,199],{"class":198},"sScJk","docker",[42,201,203],{"class":202},"sZZnC"," build",[42,205,207],{"class":206},"sj4cs"," -t",[42,209,210],{"class":202}," flask-app",[42,212,213],{"class":202}," .\n",[42,215,216],{"class":44,"line":51},[42,217,55],{"emptyLinePlaceholder":54},[42,219,220,222,225,228],{"class":44,"line":58},[42,221,199],{"class":198},[42,223,224],{"class":202}," run",[42,226,227],{"class":206}," -d",[42,229,230],{"class":206}," \\\n",[42,232,233,236,238],{"class":44,"line":64},[42,234,235],{"class":206},"  --name",[42,237,210],{"class":202},[42,239,230],{"class":206},[42,241,242,245,248],{"class":44,"line":70},[42,243,244],{"class":206},"  --restart",[42,246,247],{"class":202}," unless-stopped",[42,249,230],{"class":206},[42,251,252,255,258],{"class":44,"line":75},[42,253,254],{"class":206},"  -p",[42,256,257],{"class":202}," 8000:8000",[42,259,230],{"class":206},[42,261,262,265,268],{"class":44,"line":81},[42,263,264],{"class":206},"  --env-file",[42,266,267],{"class":202}," .env",[42,269,230],{"class":206},[42,271,272],{"class":44,"line":86},[42,273,274],{"class":202},"  flask-app\n",[26,276,278],{"id":277},"test","Test",[34,280,282],{"className":189,"code":281,"language":191,"meta":38,"style":38},"curl http:\u002F\u002F127.0.0.1:8000\n",[30,283,284],{"__ignoreMap":38},[42,285,286,289],{"class":44,"line":45},[42,287,288],{"class":198},"curl",[42,290,291],{"class":202}," http:\u002F\u002F127.0.0.1:8000\n",[14,293,294,295,300],{},"This gets a Flask app running in a production-style container with Gunicorn. For public traffic, place Nginx in front of the container and terminate HTTPS there. If you need the reverse proxy layer, use ",[296,297,299],"a",{"href":298},"\u002Fdeploy\u002Fdeploy-flask-with-nginx-plus-gunicorn-step-by-step-guide","Deploy Flask with Nginx + Gunicorn (Step-by-Step Guide)",".",[18,302,304],{"id":303},"whats-happening","What’s Happening",[14,306,307],{},"In production, Flask should not run with the built-in development server inside Docker. Docker packages the app and dependencies into a repeatable image, and Gunicorn serves the application inside the container.",[14,309,310],{},"Most failures come from one of these: wrong Gunicorn app target, missing environment variables, binding to the wrong address, port mismatch, or assuming files written inside the container will persist after redeploy.",[18,312,314],{"id":313},"step-by-step-guide","Step-by-Step Guide",[26,316,318],{"id":317},"_1-create-a-production-wsgi-entrypoint","1. Create a production WSGI entrypoint",[14,320,321,322,325],{},"Create a ",[30,323,324],{},"wsgi.py"," file at the project root.",[14,327,328],{},"If your app uses an application factory:",[34,330,334],{"className":331,"code":332,"language":333,"meta":38,"style":38},"language-python shiki shiki-themes github-light github-dark","from yourapp import create_app\n\napp = create_app()\n","python",[30,335,336,352,356],{"__ignoreMap":38},[42,337,338,342,346,349],{"class":44,"line":45},[42,339,341],{"class":340},"szBVR","from",[42,343,345],{"class":344},"sVt8B"," yourapp ",[42,347,348],{"class":340},"import",[42,350,351],{"class":344}," create_app\n",[42,353,354],{"class":44,"line":51},[42,355,55],{"emptyLinePlaceholder":54},[42,357,358,361,364],{"class":44,"line":58},[42,359,360],{"class":344},"app ",[42,362,363],{"class":340},"=",[42,365,366],{"class":344}," create_app()\n",[14,368,369,370,373],{},"If your app already exposes ",[30,371,372],{},"app"," directly:",[34,375,377],{"className":331,"code":376,"language":333,"meta":38,"style":38},"from yourapp import app\n",[30,378,379],{"__ignoreMap":38},[42,380,381,383,385,387],{"class":44,"line":45},[42,382,341],{"class":340},[42,384,345],{"class":344},[42,386,348],{"class":340},[42,388,389],{"class":344}," app\n",[14,391,392],{},"Gunicorn must be able to import the target used in the command:",[34,394,396],{"className":189,"code":395,"language":191,"meta":38,"style":38},"gunicorn wsgi:app --bind 0.0.0.0:8000 --workers 3\n",[30,397,398],{"__ignoreMap":38},[42,399,400,403,406,409,412,415],{"class":44,"line":45},[42,401,402],{"class":198},"gunicorn",[42,404,405],{"class":202}," wsgi:app",[42,407,408],{"class":206}," --bind",[42,410,411],{"class":202}," 0.0.0.0:8000",[42,413,414],{"class":206}," --workers",[42,416,417],{"class":206}," 3\n",[26,419,421],{"id":420},"_2-pin-production-dependencies","2. Pin production dependencies",[14,423,424,425,300],{},"Create or update ",[30,426,427],{},"requirements.txt",[34,429,433],{"className":430,"code":431,"language":432,"meta":38,"style":38},"language-txt shiki shiki-themes github-light github-dark","Flask==3.0.3\ngunicorn==22.0.0\npsycopg2-binary==2.9.9\n","txt",[30,434,435,440,445],{"__ignoreMap":38},[42,436,437],{"class":44,"line":45},[42,438,439],{},"Flask==3.0.3\n",[42,441,442],{"class":44,"line":51},[42,443,444],{},"gunicorn==22.0.0\n",[42,446,447],{"class":44,"line":58},[42,448,449],{},"psycopg2-binary==2.9.9\n",[14,451,452],{},"Add only the packages your app actually needs. If you use database migrations, include the migration package as well.",[26,454,456],{"id":455},"_3-create-a-production-dockerfile","3. Create a production Dockerfile",[14,458,459],{},"Use a slim Python image, install dependencies, copy the app, and start Gunicorn.",[34,461,463],{"className":36,"code":462,"language":28,"meta":38,"style":38},"FROM python:3.12-slim\n\nENV PYTHONDONTWRITEBYTECODE=1 \\\n    PYTHONUNBUFFERED=1\n\nWORKDIR \u002Fapp\n\nRUN apt-get update && apt-get install -y --no-install-recommends \\\n    build-essential \\\n    && rm -rf \u002Fvar\u002Flib\u002Fapt\u002Flists\u002F*\n\nCOPY requirements.txt .\nRUN pip install --no-cache-dir -r requirements.txt\n\nCOPY . .\n\nEXPOSE 8000\n\nCMD [\"gunicorn\", \"wsgi:app\", \"--bind\", \"0.0.0.0:8000\", \"--workers\", \"3\"]\n",[30,464,465,469,473,477,481,485,489,493,498,503,508,512,516,520,524,528,532,537,542],{"__ignoreMap":38},[42,466,467],{"class":44,"line":45},[42,468,48],{},[42,470,471],{"class":44,"line":51},[42,472,55],{"emptyLinePlaceholder":54},[42,474,475],{"class":44,"line":58},[42,476,61],{},[42,478,479],{"class":44,"line":64},[42,480,67],{},[42,482,483],{"class":44,"line":70},[42,484,55],{"emptyLinePlaceholder":54},[42,486,487],{"class":44,"line":75},[42,488,78],{},[42,490,491],{"class":44,"line":81},[42,492,55],{"emptyLinePlaceholder":54},[42,494,495],{"class":44,"line":86},[42,496,497],{},"RUN apt-get update && apt-get install -y --no-install-recommends \\\n",[42,499,500],{"class":44,"line":92},[42,501,502],{},"    build-essential \\\n",[42,504,505],{"class":44,"line":97},[42,506,507],{},"    && rm -rf \u002Fvar\u002Flib\u002Fapt\u002Flists\u002F*\n",[42,509,510],{"class":44,"line":103},[42,511,55],{"emptyLinePlaceholder":54},[42,513,514],{"class":44,"line":109},[42,515,100],{},[42,517,518],{"class":44,"line":114},[42,519,106],{},[42,521,522],{"class":44,"line":120},[42,523,55],{"emptyLinePlaceholder":54},[42,525,526],{"class":44,"line":125},[42,527,117],{},[42,529,530],{"class":44,"line":131},[42,531,55],{"emptyLinePlaceholder":54},[42,533,535],{"class":44,"line":534},17,[42,536,128],{},[42,538,540],{"class":44,"line":539},18,[42,541,55],{"emptyLinePlaceholder":54},[42,543,545],{"class":44,"line":544},19,[42,546,134],{},[14,548,549,550,553],{},"If your app needs extra OS libraries, install them in the same ",[30,551,552],{},"apt-get install"," line.",[26,555,557],{"id":556},"_4-exclude-local-and-secret-files-from-the-image","4. Exclude local and secret files from the image",[14,559,560,561,300],{},"Create ",[30,562,140],{},[34,564,566],{"className":143,"code":565,"language":145,"meta":38,"style":38},"__pycache__\u002F\n*.pyc\n*.pyo\n*.pyd\n.pytest_cache\u002F\nvenv\u002F\n.env\n.git\n.gitignore\n",[30,567,568,572,576,580,584,589,593,597,601],{"__ignoreMap":38},[42,569,570],{"class":44,"line":45},[42,571,152],{},[42,573,574],{"class":44,"line":51},[42,575,157],{},[42,577,578],{"class":44,"line":58},[42,579,162],{},[42,581,582],{"class":44,"line":64},[42,583,167],{},[42,585,586],{"class":44,"line":70},[42,587,588],{},".pytest_cache\u002F\n",[42,590,591],{"class":44,"line":75},[42,592,172],{},[42,594,595],{"class":44,"line":81},[42,596,177],{},[42,598,599],{"class":44,"line":86},[42,600,182],{},[42,602,603],{"class":44,"line":92},[42,604,605],{},".gitignore\n",[14,607,608,609,612],{},"Do not bake ",[30,610,611],{},".env"," into the image.",[26,614,616],{"id":615},"_5-configure-flask-for-production-via-environment-variables","5. Configure Flask for production via environment variables",[14,618,619],{},"Use runtime environment variables instead of hardcoded values.",[14,621,622,623,625],{},"Example ",[30,624,611],{},":",[34,627,631],{"className":628,"code":629,"language":630,"meta":38,"style":38},"language-env shiki shiki-themes github-light github-dark","SECRET_KEY=change-me\nDATABASE_URL=postgresql:\u002F\u002Fuser:password@db-host:5432\u002Fappdb\nFLASK_ENV=production\n","env",[30,632,633,638,643],{"__ignoreMap":38},[42,634,635],{"class":44,"line":45},[42,636,637],{},"SECRET_KEY=change-me\n",[42,639,640],{"class":44,"line":51},[42,641,642],{},"DATABASE_URL=postgresql:\u002F\u002Fuser:password@db-host:5432\u002Fappdb\n",[42,644,645],{"class":44,"line":58},[42,646,647],{},"FLASK_ENV=production\n",[14,649,650],{},"Example config usage in Flask:",[34,652,654],{"className":331,"code":653,"language":333,"meta":38,"style":38},"import os\n\nclass Config:\n    SECRET_KEY = os.environ[\"SECRET_KEY\"]\n    SQLALCHEMY_DATABASE_URI = os.environ[\"DATABASE_URL\"]\n    DEBUG = False\n",[30,655,656,663,667,678,695,709],{"__ignoreMap":38},[42,657,658,660],{"class":44,"line":45},[42,659,348],{"class":340},[42,661,662],{"class":344}," os\n",[42,664,665],{"class":44,"line":51},[42,666,55],{"emptyLinePlaceholder":54},[42,668,669,672,675],{"class":44,"line":58},[42,670,671],{"class":340},"class",[42,673,674],{"class":198}," Config",[42,676,677],{"class":344},":\n",[42,679,680,683,686,689,692],{"class":44,"line":64},[42,681,682],{"class":206},"    SECRET_KEY",[42,684,685],{"class":340}," =",[42,687,688],{"class":344}," os.environ[",[42,690,691],{"class":202},"\"SECRET_KEY\"",[42,693,694],{"class":344},"]\n",[42,696,697,700,702,704,707],{"class":44,"line":70},[42,698,699],{"class":206},"    SQLALCHEMY_DATABASE_URI",[42,701,685],{"class":340},[42,703,688],{"class":344},[42,705,706],{"class":202},"\"DATABASE_URL\"",[42,708,694],{"class":344},[42,710,711,714,716],{"class":44,"line":75},[42,712,713],{"class":206},"    DEBUG",[42,715,685],{"class":340},[42,717,718],{"class":206}," False\n",[14,720,721,722,300],{},"For a full environment-variable setup, use ",[296,723,725],{"href":724},"\u002Fdeploy\u002Fflask-environment-variables-and-secrets-setup","Flask Environment Variables and Secrets Setup",[26,727,729],{"id":728},"_6-build-the-image","6. Build the image",[34,731,733],{"className":189,"code":732,"language":191,"meta":38,"style":38},"docker build -t flask-app .\n",[30,734,735],{"__ignoreMap":38},[42,736,737,739,741,743,745],{"class":44,"line":45},[42,738,199],{"class":198},[42,740,203],{"class":202},[42,742,207],{"class":206},[42,744,210],{"class":202},[42,746,213],{"class":202},[14,748,749],{},"Confirm the build completes without copying secrets or local virtualenv files.",[26,751,753],{"id":752},"_7-run-the-container-with-restart-policy-and-environment-file","7. Run the container with restart policy and environment file",[34,755,757],{"className":189,"code":756,"language":191,"meta":38,"style":38},"docker run -d \\\n  --name flask-app \\\n  --restart unless-stopped \\\n  -p 8000:8000 \\\n  --env-file .env \\\n  flask-app\n",[30,758,759,769,777,785,793,801],{"__ignoreMap":38},[42,760,761,763,765,767],{"class":44,"line":45},[42,762,199],{"class":198},[42,764,224],{"class":202},[42,766,227],{"class":206},[42,768,230],{"class":206},[42,770,771,773,775],{"class":44,"line":51},[42,772,235],{"class":206},[42,774,210],{"class":202},[42,776,230],{"class":206},[42,778,779,781,783],{"class":44,"line":58},[42,780,244],{"class":206},[42,782,247],{"class":202},[42,784,230],{"class":206},[42,786,787,789,791],{"class":44,"line":64},[42,788,254],{"class":206},[42,790,257],{"class":202},[42,792,230],{"class":206},[42,794,795,797,799],{"class":44,"line":70},[42,796,264],{"class":206},[42,798,267],{"class":202},[42,800,230],{"class":206},[42,802,803],{"class":44,"line":75},[42,804,274],{"class":202},[14,806,807,808,811,812,300],{},"This publishes container port ",[30,809,810],{},"8000"," to host port ",[30,813,810],{},[26,815,817],{"id":816},"_8-verify-the-container-is-running-and-reachable","8. Verify the container is running and reachable",[14,819,820],{},"Check container state:",[34,822,824],{"className":189,"code":823,"language":191,"meta":38,"style":38},"docker ps -a\n",[30,825,826],{"__ignoreMap":38},[42,827,828,830,833],{"class":44,"line":45},[42,829,199],{"class":198},[42,831,832],{"class":202}," ps",[42,834,835],{"class":206}," -a\n",[14,837,838],{},"Test the app:",[34,840,841],{"className":189,"code":281,"language":191,"meta":38,"style":38},[30,842,843],{"__ignoreMap":38},[42,844,845,847],{"class":44,"line":45},[42,846,288],{"class":198},[42,848,291],{"class":202},[14,850,851],{},"If the container exits immediately, inspect logs:",[34,853,855],{"className":189,"code":854,"language":191,"meta":38,"style":38},"docker logs flask-app --tail 100\n",[30,856,857],{"__ignoreMap":38},[42,858,859,861,864,866,869],{"class":44,"line":45},[42,860,199],{"class":198},[42,862,863],{"class":202}," logs",[42,865,210],{"class":202},[42,867,868],{"class":206}," --tail",[42,870,871],{"class":206}," 100\n",[26,873,875],{"id":874},"_9-mount-persistent-storage-if-the-app-writes-files","9. Mount persistent storage if the app writes files",[14,877,878],{},"Do not rely on the container filesystem for uploads or generated files that must survive container replacement.",[14,880,881],{},"Example with a host-mounted directory:",[34,883,885],{"className":189,"code":884,"language":191,"meta":38,"style":38},"docker run -d \\\n  --name flask-app \\\n  --restart unless-stopped \\\n  -p 8000:8000 \\\n  --env-file .env \\\n  -v \u002Fsrv\u002Fflask\u002Fuploads:\u002Fapp\u002Fuploads \\\n  flask-app\n",[30,886,887,897,905,913,921,929,939],{"__ignoreMap":38},[42,888,889,891,893,895],{"class":44,"line":45},[42,890,199],{"class":198},[42,892,224],{"class":202},[42,894,227],{"class":206},[42,896,230],{"class":206},[42,898,899,901,903],{"class":44,"line":51},[42,900,235],{"class":206},[42,902,210],{"class":202},[42,904,230],{"class":206},[42,906,907,909,911],{"class":44,"line":58},[42,908,244],{"class":206},[42,910,247],{"class":202},[42,912,230],{"class":206},[42,914,915,917,919],{"class":44,"line":64},[42,916,254],{"class":206},[42,918,257],{"class":202},[42,920,230],{"class":206},[42,922,923,925,927],{"class":44,"line":70},[42,924,264],{"class":206},[42,926,267],{"class":202},[42,928,230],{"class":206},[42,930,931,934,937],{"class":44,"line":75},[42,932,933],{"class":206},"  -v",[42,935,936],{"class":202}," \u002Fsrv\u002Fflask\u002Fuploads:\u002Fapp\u002Fuploads",[42,938,230],{"class":206},[42,940,941],{"class":44,"line":81},[42,942,274],{"class":202},[14,944,945],{},"Example with a named volume:",[34,947,949],{"className":189,"code":948,"language":191,"meta":38,"style":38},"docker volume create flask_uploads\n\ndocker run -d \\\n  --name flask-app \\\n  --restart unless-stopped \\\n  -p 8000:8000 \\\n  --env-file .env \\\n  -v flask_uploads:\u002Fapp\u002Fuploads \\\n  flask-app\n",[30,950,951,964,968,978,986,994,1002,1010,1019],{"__ignoreMap":38},[42,952,953,955,958,961],{"class":44,"line":45},[42,954,199],{"class":198},[42,956,957],{"class":202}," volume",[42,959,960],{"class":202}," create",[42,962,963],{"class":202}," flask_uploads\n",[42,965,966],{"class":44,"line":51},[42,967,55],{"emptyLinePlaceholder":54},[42,969,970,972,974,976],{"class":44,"line":58},[42,971,199],{"class":198},[42,973,224],{"class":202},[42,975,227],{"class":206},[42,977,230],{"class":206},[42,979,980,982,984],{"class":44,"line":64},[42,981,235],{"class":206},[42,983,210],{"class":202},[42,985,230],{"class":206},[42,987,988,990,992],{"class":44,"line":70},[42,989,244],{"class":206},[42,991,247],{"class":202},[42,993,230],{"class":206},[42,995,996,998,1000],{"class":44,"line":75},[42,997,254],{"class":206},[42,999,257],{"class":202},[42,1001,230],{"class":206},[42,1003,1004,1006,1008],{"class":44,"line":81},[42,1005,264],{"class":206},[42,1007,267],{"class":202},[42,1009,230],{"class":206},[42,1011,1012,1014,1017],{"class":44,"line":86},[42,1013,933],{"class":206},[42,1015,1016],{"class":202}," flask_uploads:\u002Fapp\u002Fuploads",[42,1018,230],{"class":206},[42,1020,1021],{"class":44,"line":92},[42,1022,274],{"class":202},[14,1024,1025],{},"Use external storage for long-term or multi-instance deployments.",[26,1027,1029],{"id":1028},"_10-put-nginx-in-front-of-the-container","10. Put Nginx in front of the container",[14,1031,1032],{},"For public production traffic, use Nginx as the reverse proxy and terminate HTTPS there.",[14,1034,1035],{},"Basic host-level Nginx upstream example:",[34,1037,1041],{"className":1038,"code":1039,"language":1040,"meta":38,"style":38},"language-nginx shiki shiki-themes github-light github-dark","server {\n    listen 80;\n    server_name example.com;\n\n    location \u002F {\n        proxy_pass http:\u002F\u002F127.0.0.1:8000;\n        proxy_set_header Host $host;\n        proxy_set_header X-Real-IP $remote_addr;\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n        proxy_set_header X-Forwarded-Proto $scheme;\n    }\n}\n","nginx",[30,1042,1043,1048,1053,1058,1062,1067,1072,1077,1082,1087,1092,1097],{"__ignoreMap":38},[42,1044,1045],{"class":44,"line":45},[42,1046,1047],{},"server {\n",[42,1049,1050],{"class":44,"line":51},[42,1051,1052],{},"    listen 80;\n",[42,1054,1055],{"class":44,"line":58},[42,1056,1057],{},"    server_name example.com;\n",[42,1059,1060],{"class":44,"line":64},[42,1061,55],{"emptyLinePlaceholder":54},[42,1063,1064],{"class":44,"line":70},[42,1065,1066],{},"    location \u002F {\n",[42,1068,1069],{"class":44,"line":75},[42,1070,1071],{},"        proxy_pass http:\u002F\u002F127.0.0.1:8000;\n",[42,1073,1074],{"class":44,"line":81},[42,1075,1076],{},"        proxy_set_header Host $host;\n",[42,1078,1079],{"class":44,"line":86},[42,1080,1081],{},"        proxy_set_header X-Real-IP $remote_addr;\n",[42,1083,1084],{"class":44,"line":92},[42,1085,1086],{},"        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n",[42,1088,1089],{"class":44,"line":97},[42,1090,1091],{},"        proxy_set_header X-Forwarded-Proto $scheme;\n",[42,1093,1094],{"class":44,"line":103},[42,1095,1096],{},"    }\n",[42,1098,1099],{"class":44,"line":109},[42,1100,1101],{},"}\n",[14,1103,1104],{},"Then test and reload:",[34,1106,1108],{"className":189,"code":1107,"language":191,"meta":38,"style":38},"sudo nginx -t\nsudo systemctl reload nginx\n",[30,1109,1110,1121],{"__ignoreMap":38},[42,1111,1112,1115,1118],{"class":44,"line":45},[42,1113,1114],{"class":198},"sudo",[42,1116,1117],{"class":202}," nginx",[42,1119,1120],{"class":206}," -t\n",[42,1122,1123,1125,1128,1131],{"class":44,"line":51},[42,1124,1114],{"class":198},[42,1126,1127],{"class":202}," systemctl",[42,1129,1130],{"class":202}," reload",[42,1132,1133],{"class":202}," nginx\n",[14,1135,1136,1137,300],{},"If Nginx returns a 502, use ",[296,1138,1140],{"href":1139},"\u002Ffix-issues\u002Ffix-flask-502-bad-gateway-step-by-step-guide","Fix Flask 502 Bad Gateway (Step-by-Step Guide)",[26,1142,1144],{"id":1143},"_11-add-a-health-endpoint","11. Add a health endpoint",[14,1146,1147],{},"Create a lightweight health route.",[34,1149,1151],{"className":331,"code":1150,"language":333,"meta":38,"style":38},"@app.get(\"\u002Fhealth\")\ndef health():\n    return {\"status\": \"ok\"}, 200\n",[30,1152,1153,1167,1178],{"__ignoreMap":38},[42,1154,1155,1158,1161,1164],{"class":44,"line":45},[42,1156,1157],{"class":198},"@app.get",[42,1159,1160],{"class":344},"(",[42,1162,1163],{"class":202},"\"\u002Fhealth\"",[42,1165,1166],{"class":344},")\n",[42,1168,1169,1172,1175],{"class":44,"line":51},[42,1170,1171],{"class":340},"def",[42,1173,1174],{"class":198}," health",[42,1176,1177],{"class":344},"():\n",[42,1179,1180,1183,1186,1189,1192,1195,1198],{"class":44,"line":58},[42,1181,1182],{"class":340},"    return",[42,1184,1185],{"class":344}," {",[42,1187,1188],{"class":202},"\"status\"",[42,1190,1191],{"class":344},": ",[42,1193,1194],{"class":202},"\"ok\"",[42,1196,1197],{"class":344},"}, ",[42,1199,1200],{"class":206},"200\n",[14,1202,1203],{},"Validate it:",[34,1205,1207],{"className":189,"code":1206,"language":191,"meta":38,"style":38},"curl http:\u002F\u002F127.0.0.1:8000\u002Fhealth\n",[30,1208,1209],{"__ignoreMap":38},[42,1210,1211,1213],{"class":44,"line":45},[42,1212,288],{"class":198},[42,1214,1215],{"class":202}," http:\u002F\u002F127.0.0.1:8000\u002Fhealth\n",[14,1217,1218],{},"Use this during deploy validation and reverse-proxy checks.",[26,1220,1222],{"id":1221},"_12-run-database-migrations-explicitly","12. Run database migrations explicitly",[14,1224,1225],{},"Do not assume schema changes apply automatically.",[14,1227,1228],{},"Example:",[34,1230,1232],{"className":189,"code":1231,"language":191,"meta":38,"style":38},"docker exec -it flask-app flask db upgrade\n",[30,1233,1234],{"__ignoreMap":38},[42,1235,1236,1238,1241,1244,1246,1249,1252],{"class":44,"line":45},[42,1237,199],{"class":198},[42,1239,1240],{"class":202}," exec",[42,1242,1243],{"class":206}," -it",[42,1245,210],{"class":202},[42,1247,1248],{"class":202}," flask",[42,1250,1251],{"class":202}," db",[42,1253,1254],{"class":202}," upgrade\n",[14,1256,1257],{},"If migrations are part of deployment, run them as a one-off task before shifting production traffic.",[26,1259,1261],{"id":1260},"_13-validate-startup-logs-and-runtime-behavior","13. Validate startup logs and runtime behavior",[14,1263,1264],{},"Check startup logs:",[34,1266,1267],{"className":189,"code":854,"language":191,"meta":38,"style":38},[30,1268,1269],{"__ignoreMap":38},[42,1270,1271,1273,1275,1277,1279],{"class":44,"line":45},[42,1272,199],{"class":198},[42,1274,863],{"class":202},[42,1276,210],{"class":202},[42,1278,868],{"class":206},[42,1280,871],{"class":206},[14,1282,1283],{},"Look for:",[1285,1286,1287,1291,1294,1297,1300],"ul",{},[1288,1289,1290],"li",{},"successful Gunicorn worker boot",[1288,1292,1293],{},"correct app import path",[1288,1295,1296],{},"no missing environment variables",[1288,1298,1299],{},"no database connection failures",[1288,1301,1302],{},"no permission errors on mounted paths",[26,1304,1306],{"id":1305},"_14-use-compose-when-the-stack-grows","14. Use Compose when the stack grows",[14,1308,1309],{},"A single-container setup is fine for a simple app. If you add Nginx, PostgreSQL, Redis, workers, or scheduled jobs, move to Compose for service orchestration.",[14,1311,1312,1313,300],{},"See ",[296,1314,1316],{"href":1315},"\u002Fdeploy\u002Fflask-plus-docker-compose-production-setup","Flask + Docker Compose Production Setup",[18,1318,1320],{"id":1319},"common-causes","Common Causes",[1285,1322,1323,1333,1343,1350,1357,1368,1371,1385,1392,1399],{},[1288,1324,1325,1326,1329,1330],{},"Wrong Gunicorn target → Gunicorn cannot import the Flask app object → fix the module path, such as ",[30,1327,1328],{},"wsgi:app"," or ",[30,1331,1332],{},"package.wsgi:app",[1288,1334,1335,1336,1339,1340],{},"Binding to ",[30,1337,1338],{},"127.0.0.1"," inside the container → app is unreachable from outside the container → bind Gunicorn to ",[30,1341,1342],{},"0.0.0.0:8000",[1288,1344,1345,1346,1349],{},"Using ",[30,1347,1348],{},"flask run"," in production → unstable or unsafe behavior → replace it with Gunicorn",[1288,1351,1352,1353,1356],{},"Missing environment variables → app crashes at startup or loads wrong config → pass values with ",[30,1354,1355],{},"--env-file"," or deployment environment injection",[1288,1358,1359,1360,1362,1363,1365,1366],{},"Copying ",[30,1361,611],{}," into the image → secrets leak into image layers → exclude ",[30,1364,611],{}," with ",[30,1367,140],{},[1288,1369,1370],{},"Using the container filesystem for uploads → files disappear after redeploy → use named volumes or external object storage",[1288,1372,1373,1374,1377,1378,1381,1382],{},"Port mismatch → Docker publishes one port but Gunicorn listens on another → align ",[30,1375,1376],{},"EXPOSE",", ",[30,1379,1380],{},"--bind",", and ",[30,1383,1384],{},"-p",[1288,1386,1387,1388,1391],{},"Missing build dependencies → ",[30,1389,1390],{},"pip install"," fails for compiled packages → install required OS packages during image build",[1288,1393,1394,1395,1398],{},"Database host set to ",[30,1396,1397],{},"localhost"," incorrectly → the container cannot reach the real database → use the actual external host or service name",[1288,1400,1401],{},"Nginx upstream points to the wrong port → proxy returns 502 → verify container listener and proxy target",[18,1403,1405],{"id":1404},"debugging-section","Debugging Section",[14,1407,820],{},[34,1409,1410],{"className":189,"code":823,"language":191,"meta":38,"style":38},[30,1411,1412],{"__ignoreMap":38},[42,1413,1414,1416,1418],{"class":44,"line":45},[42,1415,199],{"class":198},[42,1417,832],{"class":202},[42,1419,835],{"class":206},[14,1421,1422],{},"Inspect logs:",[34,1424,1425],{"className":189,"code":854,"language":191,"meta":38,"style":38},[30,1426,1427],{"__ignoreMap":38},[42,1428,1429,1431,1433,1435,1437],{"class":44,"line":45},[42,1430,199],{"class":198},[42,1432,863],{"class":202},[42,1434,210],{"class":202},[42,1436,868],{"class":206},[42,1438,871],{"class":206},[14,1440,1441],{},"Open a shell inside the container:",[34,1443,1445],{"className":189,"code":1444,"language":191,"meta":38,"style":38},"docker exec -it flask-app sh\n",[30,1446,1447],{"__ignoreMap":38},[42,1448,1449,1451,1453,1455,1457],{"class":44,"line":45},[42,1450,199],{"class":198},[42,1452,1240],{"class":202},[42,1454,1243],{"class":206},[42,1456,210],{"class":202},[42,1458,1459],{"class":202}," sh\n",[14,1461,1462],{},"Inspect environment variables:",[34,1464,1466],{"className":189,"code":1465,"language":191,"meta":38,"style":38},"docker exec flask-app env | sort\n",[30,1467,1468],{"__ignoreMap":38},[42,1469,1470,1472,1474,1476,1479,1482],{"class":44,"line":45},[42,1471,199],{"class":198},[42,1473,1240],{"class":202},[42,1475,210],{"class":202},[42,1477,1478],{"class":202}," env",[42,1480,1481],{"class":340}," |",[42,1483,1484],{"class":198}," sort\n",[14,1486,1487],{},"Inspect container metadata:",[34,1489,1491],{"className":189,"code":1490,"language":191,"meta":38,"style":38},"docker inspect flask-app\n",[30,1492,1493],{"__ignoreMap":38},[42,1494,1495,1497,1500],{"class":44,"line":45},[42,1496,199],{"class":198},[42,1498,1499],{"class":202}," inspect",[42,1501,1502],{"class":202}," flask-app\n",[14,1504,1505],{},"Inspect image metadata:",[34,1507,1509],{"className":189,"code":1508,"language":191,"meta":38,"style":38},"docker image inspect flask-app\n",[30,1510,1511],{"__ignoreMap":38},[42,1512,1513,1515,1518,1520],{"class":44,"line":45},[42,1514,199],{"class":198},[42,1516,1517],{"class":202}," image",[42,1519,1499],{"class":202},[42,1521,1502],{"class":202},[14,1523,1524],{},"Test the app directly on the published port:",[34,1526,1527],{"className":189,"code":281,"language":191,"meta":38,"style":38},[30,1528,1529],{"__ignoreMap":38},[42,1530,1531,1533],{"class":44,"line":45},[42,1532,288],{"class":198},[42,1534,291],{"class":202},[14,1536,1537],{},"Check a specific environment variable:",[34,1539,1541],{"className":189,"code":1540,"language":191,"meta":38,"style":38},"docker exec -it flask-app python -c \"import os; print(os.getenv('FLASK_ENV'))\"\n",[30,1542,1543],{"__ignoreMap":38},[42,1544,1545,1547,1549,1551,1553,1556,1559],{"class":44,"line":45},[42,1546,199],{"class":198},[42,1548,1240],{"class":202},[42,1550,1243],{"class":206},[42,1552,210],{"class":202},[42,1554,1555],{"class":202}," python",[42,1557,1558],{"class":206}," -c",[42,1560,1561],{"class":202}," \"import os; print(os.getenv('FLASK_ENV'))\"\n",[14,1563,1564],{},"If the app exits immediately, start a shell instead of the default command:",[34,1566,1568],{"className":189,"code":1567,"language":191,"meta":38,"style":38},"docker run --rm -it --entrypoint sh flask-app\n",[30,1569,1570],{"__ignoreMap":38},[42,1571,1572,1574,1576,1579,1581,1584,1587],{"class":44,"line":45},[42,1573,199],{"class":198},[42,1575,224],{"class":202},[42,1577,1578],{"class":206}," --rm",[42,1580,1243],{"class":206},[42,1582,1583],{"class":206}," --entrypoint",[42,1585,1586],{"class":202}," sh",[42,1588,1502],{"class":202},[14,1590,1591],{},"What to look for:",[1285,1593,1594,1603,1609,1612,1615],{},[1288,1595,1596,1329,1599,1602],{},[30,1597,1598],{},"ModuleNotFoundError",[30,1600,1601],{},"ImportError"," → wrong app import path or missing package",[1288,1604,1605,1608],{},[30,1606,1607],{},"KeyError"," for config values → missing environment variables",[1288,1610,1611],{},"bind errors → wrong port or process already using the port",[1288,1613,1614],{},"connection refused to the database → wrong DB host, port, credentials, or firewall",[1288,1616,1617],{},"missing files on mounted paths → incorrect volume target or permissions",[14,1619,1620],{},"If Nginx is involved, test both layers separately:",[1622,1623,1624,1627],"ol",{},[1288,1625,1626],{},"Curl the container port directly",[1288,1628,1629],{},"Curl through Nginx",[14,1631,1632],{},"This isolates whether the failure is in the app container or the reverse proxy.",[18,1634,1636],{"id":1635},"checklist","Checklist",[1285,1638,1641,1650,1656,1664,1670,1676,1682,1688,1694,1700],{"className":1639},[1640],"contains-task-list",[1288,1642,1645,1649],{"className":1643},[1644],"task-list-item",[1646,1647],"input",{"disabled":54,"type":1648},"checkbox"," Docker image builds successfully without copying secrets into the image",[1288,1651,1653,1655],{"className":1652},[1644],[1646,1654],{"disabled":54,"type":1648}," Gunicorn starts the correct Flask app target",[1288,1657,1659,1661,1662],{"className":1658},[1644],[1646,1660],{"disabled":54,"type":1648}," The container listens on ",[30,1663,1342],{},[1288,1665,1667,1669],{"className":1666},[1644],[1646,1668],{"disabled":54,"type":1648}," Required environment variables are provided at runtime",[1288,1671,1673,1675],{"className":1672},[1644],[1646,1674],{"disabled":54,"type":1648}," Debug mode is disabled in production",[1288,1677,1679,1681],{"className":1678},[1644],[1646,1680],{"disabled":54,"type":1648}," Static and media storage paths are handled correctly for production",[1288,1683,1685,1687],{"className":1684},[1644],[1646,1686],{"disabled":54,"type":1648}," Persistent data is stored in volumes or external services",[1288,1689,1691,1693],{"className":1690},[1644],[1646,1692],{"disabled":54,"type":1648}," The app responds successfully on the published port",[1288,1695,1697,1699],{"className":1696},[1644],[1646,1698],{"disabled":54,"type":1648}," Nginx can proxy to the container if used",[1288,1701,1703,1705],{"className":1702},[1644],[1646,1704],{"disabled":54,"type":1648}," Logs show clean startup with no import, permission, or database errors",[14,1707,1708,1709,300],{},"For final production validation, use ",[296,1710,1712],{"href":1711},"\u002Fchecklist\u002Fflask-production-checklist-everything-you-must-do","Flask Production Checklist (Everything You Must Do)",[18,1714,1716],{"id":1715},"related-guides","Related Guides",[1285,1718,1719,1723,1727,1731],{},[1288,1720,1721],{},[296,1722,299],{"href":298},[1288,1724,1725],{},[296,1726,1316],{"href":1315},[1288,1728,1729],{},[296,1730,725],{"href":724},[1288,1732,1733],{},[296,1734,1712],{"href":1711},[18,1736,1738],{"id":1737},"faq","FAQ",[26,1740,1742],{"id":1741},"can-i-deploy-flask-with-only-docker-and-no-docker-compose","Can I deploy Flask with only Docker and no Docker Compose?",[14,1744,1745],{},"Yes. A single-container setup works. Compose becomes useful when you add Nginx, PostgreSQL, Redis, or worker services.",[26,1747,1749],{"id":1748},"should-i-expose-flask-directly-to-the-internet-from-the-container","Should I expose Flask directly to the internet from the container?",[14,1751,1752],{},"Not recommended. Put Nginx or another reverse proxy in front for TLS and request handling.",[26,1754,1756],{"id":1755},"what-is-the-correct-gunicorn-bind-address-in-docker","What is the correct Gunicorn bind address in Docker?",[14,1758,1759,1760,1763,1764,300],{},"Use ",[30,1761,1762],{},"0.0.0.0"," with the internal port, such as ",[30,1765,1342],{},[26,1767,1769],{"id":1768},"where-should-secrets-go-in-a-docker-based-flask-deployment","Where should secrets go in a Docker-based Flask deployment?",[14,1771,1772],{},"Inject them at runtime through environment variables, secret managers, or deployment platform configuration. Do not bake them into the image.",[26,1774,1776],{"id":1775},"why-does-my-app-work-locally-but-fail-in-the-container","Why does my app work locally but fail in the container?",[14,1778,1779],{},"Usually due to an incorrect import path, missing dependencies, missing environment variables, or assumptions about local files and services.",[18,1781,1783],{"id":1782},"final-takeaway","Final Takeaway",[14,1785,1786],{},"A production Flask Docker setup is mainly about using Gunicorn correctly, injecting runtime configuration safely, and avoiding ephemeral-container assumptions. If the app target, bind address, environment variables, reverse proxy wiring, and storage strategy are correct, the setup is usually stable and repeatable.",[1788,1789,1790],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}",{"title":38,"searchDepth":51,"depth":51,"links":1792},[1793,1799,1800,1816,1817,1818,1819,1820,1827],{"id":20,"depth":51,"text":21,"children":1794},[1795,1796,1797,1798],{"id":28,"depth":58,"text":32},{"id":137,"depth":58,"text":140},{"id":185,"depth":58,"text":186},{"id":277,"depth":58,"text":278},{"id":303,"depth":51,"text":304},{"id":313,"depth":51,"text":314,"children":1801},[1802,1803,1804,1805,1806,1807,1808,1809,1810,1811,1812,1813,1814,1815],{"id":317,"depth":58,"text":318},{"id":420,"depth":58,"text":421},{"id":455,"depth":58,"text":456},{"id":556,"depth":58,"text":557},{"id":615,"depth":58,"text":616},{"id":728,"depth":58,"text":729},{"id":752,"depth":58,"text":753},{"id":816,"depth":58,"text":817},{"id":874,"depth":58,"text":875},{"id":1028,"depth":58,"text":1029},{"id":1143,"depth":58,"text":1144},{"id":1221,"depth":58,"text":1222},{"id":1260,"depth":58,"text":1261},{"id":1305,"depth":58,"text":1306},{"id":1319,"depth":51,"text":1320},{"id":1404,"depth":51,"text":1405},{"id":1635,"depth":51,"text":1636},{"id":1715,"depth":51,"text":1716},{"id":1737,"depth":51,"text":1738,"children":1821},[1822,1823,1824,1825,1826],{"id":1741,"depth":58,"text":1742},{"id":1748,"depth":58,"text":1749},{"id":1755,"depth":58,"text":1756},{"id":1768,"depth":58,"text":1769},{"id":1775,"depth":58,"text":1776},{"id":1782,"depth":51,"text":1783},"Complete guide on flask + docker production setup (complete guide) for Flask production environments.","md",{"ogTitle":5,"ogDescription":1828,"twitterCard":1831,"robots":1832,"canonical":1833},"summary_large_image","index, follow","https:\u002F\u002Fflask-deployment.com\u002Fdeploy\u002Fflask-plus-docker-production-setup-complete-guide","\u002Fdeploy\u002Fflask-plus-docker-production-setup-complete-guide",{"title":5,"description":1828},"deploy\u002Fflask-plus-docker-production-setup-complete-guide","wVQ_4Yksigr4MSg_9qPZPu8L_BiygC4hWgGVEqheOqA",1776805765064]