Skip to content

Commit bad7876

Browse files
committed
docker: increase ulimit for open sockets
1 parent a857688 commit bad7876

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

docker/backend/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM debian:12
2+
RUN apt update && apt install -y curl libpq-dev libssl-dev ca-certificates && rm -rf /var/lib/apt/lists/*
3+
4+
ENV DATABASE_URL=${DATABASE_URL}
5+
ENV JWT_SECRET=${JWT_SECRET}
6+
ENV EMAIL_USER=${EMAIL_USER}
7+
ENV EMAIL_PASS=${EMAIL_PASS}
8+
ENV EMAIL_RELAY=${EMAIL_RELAY}
9+
ENV EMAIL_RELAY_PORT=${EMAIL_RELAY_PORT}
10+
ENV FRONTEND_URL=${FRONTEND_URL}
11+
ENV SERVER_NAME=${SERVER_NAME}
12+
ENV MONITORING_EMAIL=${MONITORING_EMAIL}
13+
ENV SENDER_EMAIL=${SENDER_EMAIL}
14+
ENV SENDER_NAME=${SENDER_NAME}
15+
ENV BRAND=${BRAND}

docker/docker-compose.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
services:
22
nginx:
3-
image: nginx:1.25
3+
build:
4+
dockerfile: nginx/Dockerfile
45
restart: always
56
depends_on:
67
backend:
@@ -32,10 +33,11 @@ services:
3233
- ../db_connector:/db_connector
3334

3435
backend:
35-
image: rust:1-bookworm
3636
restart: always
3737
container_name: backend
38-
command: ./backend
38+
command: bash -c "ulimit -n 10000 && exec ./backend"
39+
build:
40+
dockerfile: backend/Dockerfile
3941
user: "${UID:-1000}:${GID:-1000}"
4042
depends_on:
4143
postgres:

docker/nginx/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FROM nginx:1.25
2+
ENV SERVICEDOMAIN=${SERVICEDOMAIN}

docker/nginx/config/default.conf.template

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ upstream host_service {
22
server backend:8081;
33
}
44

5+
worker_rlimit_nofile 10000;
6+
57
map $remote_addr $remote_addr_anon {
68
~(?P<ip>\d+\.\d+\.\d+)\. $ip.0;
79
~(?P<ip>[^:]+:[^:]+): $ip::;

0 commit comments

Comments
 (0)