我正在使用uWSGI构建Docker容器,并使用以下#!/usr/bin/env python3
import subprocess
import numpy as np
from PIL import Image
palette = [
0,0,0,
0,0,255,
15,29,15,
26,141,52,
41,41,41,
65,105,225,
85,11,18,
128,0,128,
135,206,236,
144,238,144,
159,30,81,
165,42,42,
166,141,95,
169,169,169,
173,216,230,
211,211,211,
230,208,122,
245,245,220,
247,214,193,
255,0,0,
255,165,0,
255,192,203,
255,255,0,
255,255,255
] + [0,] * 232 * 3
# Write "map.png" that is a 24x1 pixel image with one pixel for each colour
entries = 24
resnp = np.arange(entries,dtype=np.uint8).reshape(24,1)
resim = Image.fromarray(resnp, mode='P')
resim.putpalette(palette)
resim.save('map.png')
# Use Imagemagick to remap to palette saved above in 'map.png'
# magick lion.png +dither -quantize Lab -remap map.png result.png
subprocess.run(['magick', 'lion.png', '+dither', '-quantize', 'Lab', '-remap', 'map.png', 'result.png'])
指令(相关摘录):
Dockerfile
稍后,当调用WebSocket时,我遇到此错误消息:
您需要使用SSL支持构建uWSGI才能使用websocket 握手api函数
如何在基于Debian的Docker映像的上下文中构建具有SSL支持的uWSGI?