-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathDockerfile.bot-api
More file actions
27 lines (23 loc) · 935 Bytes
/
Dockerfile.bot-api
File metadata and controls
27 lines (23 loc) · 935 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
FROM aiogram/telegram-bot-api:latest
# Install dependencies
RUN apk add nginx openssl \
&& mkdir /run/nginx/ \
# Generate self-signed certificate
&& openssl \
req -x509 -nodes -days 365000 -subj "/C=CA/ST=QC/O=Bot API/CN=bot-api" -newkey rsa:2048 \
-keyout /etc/ssl/private/nginx-selfsigned.key \
-out /etc/ssl/certs/nginx-selfsigned.crt \
# Create nginx config
&& echo $'\n\
server { \n\
listen 443 ssl http2 default_server; \n\
listen [::]:443 ssl http2 default_server; \n\
ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt; \n\
ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key; \n\
location / { \n\
client_max_body_size 2000M; \n\
proxy_pass http://127.0.0.1:8081; \n\
} \n\
}' > /etc/nginx/conf.d/default.conf \
# Add nginx to entrypoint
&& echo -e "#!/bin/sh \n nginx \n$(cat /docker-entrypoint.sh)" > /docker-entrypoint.sh