Commit 0e4a800 1 parent e791ded commit 0e4a800 Copy full SHA for 0e4a800
File tree 10 files changed +46
-112
lines changed
10 files changed +46
-112
lines changed Original file line number Diff line number Diff line change @@ -9,14 +9,16 @@ volumes:
9
9
10
10
steps :
11
11
- name : Test Python
12
- image : python:3.11
12
+ image : python:3.11-slim-bullseye
13
13
commands :
14
+ - apt-get update && apt-get install -y curl git
14
15
- ln -fs .env.development .env
15
16
- pip install -r requirements.txt
16
17
- pip install -r requirements-test.txt
17
18
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > "${HOME}/bin/cc-test-reporter"
18
19
- chmod +x "${HOME}/bin/cc-test-reporter"
19
20
- flake8
21
+ - gunicorn -c config/gunicorn.conf.py --check-config
20
22
- mypy . --ignore-missing-imports --strict
21
23
- cc-test-reporter before-build
22
24
- coverage run -m unittest discover
Original file line number Diff line number Diff line change 1
- FROM node:18 as node
1
+ FROM node:18-slim as node
2
2
WORKDIR /
3
3
COPY . .
4
4
RUN npm ci --only=production \
5
5
&& npm run minify
6
6
7
7
8
- # Need buster for uwsgi builds
9
- FROM python:3.11-buster
8
+ FROM python:3.11-slim-bullseye
10
9
11
10
LABEL maintainer="git@albertyw.com"
12
11
EXPOSE 5000
Original file line number Diff line number Diff line change @@ -10,5 +10,5 @@ IFS=$'\n\t'
10
10
rm -rf static/mount/*
11
11
cp -r static/* static/mount || true
12
12
13
- # Run supervisor to run uwsgi
13
+ # Run supervisor to run gunicorn
14
14
supervisord -c config/supervisord.conf
Original file line number Diff line number Diff line change
1
+ import multiprocessing
2
+
3
+
4
+ proc_name = 'chase-center-calendar'
5
+ wsgi_app = 'app.serve:app'
6
+
7
+ bind = '0.0.0.0:5000'
8
+ forwarded_allow_ips = '*'
9
+ workers = multiprocessing .cpu_count () * 2 + 1
10
+ preload_app = True
11
+
12
+ accesslog = '/var/www/app/logs/gunicorn/access.log'
13
+ errorlog = '/var/www/app/logs/gunicorn/error.log'
14
+ access_log_format = (
15
+ '%({x-forwarded-for}i)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" '
16
+ '"%(a)s"'
17
+ )
18
+
19
+ max_requests = 5000
20
+ max_requests_jitter = 1000
Original file line number Diff line number Diff line change @@ -4,11 +4,11 @@ logfile=/var/www/app/logs/supervisord/supervisord.log
4
4
pidfile=/var/run/supervisord.pid
5
5
user=root
6
6
7
- [program:uwsgi ]
8
- command=/usr/local/bin/uwsgi --ini /var/www/app/config/uwsgi/website.ini
7
+ [program:gunicorn ]
8
+ command=gunicorn -c /var/www/app/config/gunicorn.conf.py
9
9
directory=/var/www/app
10
- stdout_logfile=/var/www/app/logs/supervisord/uwsgi -stdout.log
11
- stderr_logfile=/var/www/app/logs/supervisord/uwsgi -stderr.log
10
+ stdout_logfile=/var/www/app/logs/supervisord/gunicorn -stdout.log
11
+ stderr_logfile=/var/www/app/logs/supervisord/gunicorn -stderr.log
12
12
stdout_logfile_maxbytes=10000000
13
13
stderr_logfile_maxbytes=10000000
14
14
autostart=true
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ * log *
Original file line number Diff line number Diff line change 1
1
# Core packages
2
2
python-dotenv == 0.21.0 # Read environment variables from .env
3
3
Flask == 2.2.2 # Web microframework
4
- uWSGI == 2.0.21 # Application server
4
+ gunicorn == 20.1.0 # WSGI server
5
5
syspath == 3.0.1 # Modify paths
6
6
7
7
# Features
@@ -14,4 +14,5 @@ python-slugify==7.0.0 # Generate string slugs
14
14
# Monitoring/tracking/logging
15
15
blinker == 1.5 # Dependency of rollbar
16
16
rollbar == 0.16.3 # rollbar.com error logging
17
- varsnap == 1.5.4 # Test discovery
17
+ setproctitle == 1.3.2 # Allow gunicorn to set process title
18
+ varsnap == 1.5.5 # Test discovery
You can’t perform that action at this time.
0 commit comments