Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
50 lines (50 loc) · 1.69 KB
/
Copy pathdocker-compose.yml
File metadata and controls
50 lines (50 loc) · 1.69 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#version: '3.9'
name: spring-api
services:
api-1:
container_name: api-1
build: .
#image: spring-api-service:latest
# image: baekaku/spring-api-native:latest
# extra_hosts:
# - "host.docker.internal:host-gateway"
restart: unless-stopped
ports:
- '8080:8080'
expose:
- 8080
networks:
- docker-network
environment:
- WORKER_ID=1
# - APP_COOKIE_DOMAIN=example.com # share auth cookies with a frontend on another subdomain (blank = host-only)
# - SPRING_PROFILES_ACTIVE=localdocker
# - JAVA_OPTS=-Xmx512m -Xms512m
deploy:
resources:
limits:
cpus: "2.0" # Max 2 CPU cores
memory: "2G" # Max 2GB RAM
reservations:
cpus: "1.0" # Reserve at least 1 CPU
memory: "1G" # Reserve at least 1GB RAM
volumes:
# /usr/spring-data is served publicly at /cdn/**: keep the host log and config dirs outside the host data dir too
- d:\code\spring-data:/usr/spring-data
- d:\code\spring-logs:/usr/spring-logs
# external config (secrets), read-only; create_host_path: false so a missing host dir fails instead of
# mounting an empty one (the app would then start without its external config)
- type: bind
source: d:\code\spring-config
target: /usr/spring-config
read_only: true
bind:
create_host_path: false
#linux
# - /mnt/cdn/spring-data:/usr/spring-data
# - /mnt/cdn/spring-logs:/usr/spring-logs
# - {type: bind, source: /mnt/cdn/spring-config, target: /usr/spring-config, read_only: true, bind: {create_host_path: false}}
networks:
docker-network:
driver: bridge
# external: true