1
.vscode/extensions.json
vendored
1
.vscode/extensions.json
vendored
@ -7,5 +7,6 @@
|
||||
"streetsidesoftware.code-spell-checker",
|
||||
"qwtel.sqlite-viewer",
|
||||
"jebbs.markdown-extended",
|
||||
"william-voyek.vscode-nginx",
|
||||
]
|
||||
}
|
32
dockerfile
32
dockerfile
@ -3,6 +3,7 @@ ARG CI_COMMIT_SHA=''
|
||||
ARG CI_COMMIT_TAG=''
|
||||
|
||||
ARG ALPINE_VERSION=3.20
|
||||
ARG NGINX_VERSION=1.27.2-r1
|
||||
ARG PYTHON_VERSION=3.11.10
|
||||
|
||||
FROM python:${PYTHON_VERSION}-alpine${ALPINE_VERSION} as build
|
||||
@ -30,8 +31,24 @@ RUN apk add --update \
|
||||
pkgconf \
|
||||
postgresql16-dev \
|
||||
postgresql16-client \
|
||||
libpq-dev
|
||||
libpq-dev \
|
||||
# NginX: to download items
|
||||
openssl \
|
||||
curl \
|
||||
ca-certificates
|
||||
|
||||
RUN printf "%s%s%s%s\n" \
|
||||
"@nginx " \
|
||||
"http://nginx.org/packages/mainline/alpine/v" \
|
||||
`egrep -o '^[0-9]+\.[0-9]+' /etc/alpine-release` \
|
||||
"/main" \
|
||||
| tee -a /etc/apk/repositories
|
||||
|
||||
RUN curl -o /tmp/nginx_signing.rsa.pub https://nginx.org/keys/nginx_signing.rsa.pub; \
|
||||
openssl rsa -pubin -in /tmp/nginx_signing.rsa.pub -text -noout;
|
||||
|
||||
|
||||
|
||||
RUN pip install --upgrade \
|
||||
setuptools \
|
||||
wheel \
|
||||
@ -77,6 +94,8 @@ ARG CI_PROJECT_URL
|
||||
ARG CI_COMMIT_SHA
|
||||
ARG CI_COMMIT_TAG
|
||||
|
||||
ARG NGINX_VERSION
|
||||
|
||||
ENV CI_PROJECT_URL=${CI_PROJECT_URL}
|
||||
ENV CI_COMMIT_SHA=${CI_COMMIT_SHA}
|
||||
ENV CI_COMMIT_TAG=${CI_COMMIT_TAG}
|
||||
@ -89,6 +108,11 @@ COPY ./app/. app
|
||||
|
||||
COPY --from=build /tmp/python_builds /tmp/python_builds
|
||||
|
||||
COPY --from=build /etc/apk/repositories /etc/apk/repositories
|
||||
|
||||
COPY --from=build /tmp/nginx_signing.rsa.pub /etc/apk/keys/nginx_signing.rsa.pub
|
||||
|
||||
|
||||
COPY includes/ /
|
||||
|
||||
RUN pip --disable-pip-version-check list --outdated --format=json | \
|
||||
@ -98,10 +122,14 @@ RUN pip --disable-pip-version-check list --outdated --format=json | \
|
||||
apk add --no-cache \
|
||||
mariadb-client \
|
||||
mariadb-dev \
|
||||
postgresql16-client; \
|
||||
postgresql16-client \
|
||||
nginx@nginx=${NGINX_VERSION}; \
|
||||
pip install --no-cache-dir /tmp/python_builds/*.*; \
|
||||
python /app/manage.py collectstatic --noinput; \
|
||||
rm -rf /tmp/python_builds; \
|
||||
ln -s /etc/nginx/sites-available/myproject /etc/nginx/sites-enabled; \
|
||||
# Check for errors and fail if so
|
||||
nginx -t; \
|
||||
export
|
||||
|
||||
|
||||
|
21
includes/etc/nginx/sites-available/centurion-erp
Normal file
21
includes/etc/nginx/sites-available/centurion-erp
Normal file
@ -0,0 +1,21 @@
|
||||
server {
|
||||
|
||||
listen 8000;
|
||||
|
||||
location = /favicon.ico { access_log off; log_not_found off; }
|
||||
|
||||
location /static/ {
|
||||
|
||||
root /app/static;
|
||||
|
||||
}
|
||||
|
||||
location / {
|
||||
|
||||
include proxy_params;
|
||||
|
||||
proxy_pass http://unix:/run/gunicorn.sock;
|
||||
|
||||
}
|
||||
|
||||
}
|
8
includes/etc/supervisor/conf.d/nginx.conf
Normal file
8
includes/etc/supervisor/conf.d/nginx.conf
Normal file
@ -0,0 +1,8 @@
|
||||
[program:nginx]
|
||||
startsecs=0
|
||||
stopwaitsecs=55
|
||||
command=nginx -g daemon off
|
||||
autorestart=true
|
||||
autostart=true
|
||||
stdout_logfile=/var/log/%(program_name)s.log
|
||||
stderr_logfile=/var/log/%(program_name)s.log
|
Reference in New Issue
Block a user