Nameless-Docker-Rootless/docker-compose.hardened.yaml
2023-05-10 17:22:21 +02:00

63 lines
1.3 KiB
YAML

version: '2.4'
services:
nginx:
image: namelessmc/nginx:v2.1
ports: ['8080:8080']
volumes:
- type: bind # same as php container
source: ./web
target: /data
# environment:
# Change this if you rename the php container
# PHP_FPM: php:9000
depends_on: [php]
user: '1000' # change this
cap_drop: ['ALL']
cap_add: ['NET_RAW']
mem_limit: 1024M
cpus: 1
ulimits:
nofile: 50000
nproc: 5000
security_opt: ['no-new-privileges:true']
# restart: always
php:
image: namelessmc/php:v2.1
volumes:
- type: bind # same as web container
source: ./web
target: /data
- target: /tmp
tmpfs:
size: 25M
type: tmpfs
depends_on: [db]
user: '1000' # change this
cap_drop: ['ALL']
cap_add: ['NET_RAW']
cpus: 2
mem_limit: 2048M
read_only: true
ulimits:
nofile: 5000
nproc: 5000
security_opt: ['no-new-privileges:true']
# restart: always
db:
image: mariadb
volumes:
- type: bind
source: ./db
target: /var/lib/mysql
user: '1000' # change this
environment:
MARIADB_ROOT_PASSWORD: nameless
MARIADB_USER: nameless
MARIADB_PASSWORD: nameless
MARIADB_DATABASE: nameless
# restart: always