~dricottone/container-images

8ffffdd7748e8df768d4178461734fa4e5e1df7e — Dominic Ricottone a month ago 16910ad
Experimental pypy2+uwsgi container
3 files changed, 51 insertions(+), 0 deletions(-)

A uwsgi/Dockerfile
A uwsgi/Makefile
A uwsgi/uwsgi.ini
A uwsgi/Dockerfile => uwsgi/Dockerfile +23 -0
@@ 0,0 1,23 @@
FROM alpine:edge AS builder

RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/ pypy musl-dev linux-headers gcc
RUN pypy -m ensurepip
RUN pypy -m pip install --upgrade --no-warn-script-location pip wheel
RUN pypy -m pip install --no-warn-script-location uwsgi

FROM alpine:edge

RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/ pypy
COPY --from=builder /usr/lib/pypy /usr/lib/pypy

# user `uwsgi` should be created with PID=100:GID=101
RUN addgroup -S uwsgi
RUN adduser -SD -h /var/www -s /sbin/nologin -G uwsgi -g uwsgi uwsgi

USER uwsgi
WORKDIR /var/www
COPY --chown=uwsgi:uwsgi uwsgi.ini /var/www/uwsgi.ini

EXPOSE 9000
CMD ["/usr/lib/pypy/bin/uwsgi", "--ini", "/var/www/uwsgi.ini"]


A uwsgi/Makefile => uwsgi/Makefile +13 -0
@@ 0,0 1,13 @@
CONMAN=sudo docker

REGISTRY=registry.intra.dominic-ricottone.com
IMAGE=uwsgi
TAG=latest

image:
	$(CONMAN) buildx build --push --progress=plain \
		--platform linux/arm64,linux/amd64 \
		--tag $(REGISTRY)/$(IMAGE):$(TAG) \
		.

.PHONY: image

A uwsgi/uwsgi.ini => uwsgi/uwsgi.ini +15 -0
@@ 0,0 1,15 @@
[uwsgi]
uid = uwsgi
gid = uwsgi
socket = :9000
plugin = pypy

chdir = /var/www
wsgi-file = /var/www/app.wsgi

master
workers = 3
max-requests = 200
harakiri = 60
die-on-term