-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
54 lines (52 loc) · 1.44 KB
/
docker-compose.yml
File metadata and controls
54 lines (52 loc) · 1.44 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
51
52
53
54
version: '3.8'
services:
# Build base image for program execution
pyexecutorhub-base:
build:
context: .
dockerfile: Dockerfile
image: pyexecutorhub-base:latest
# This service only builds the image, doesn't run
command: ["echo", "Base image built successfully"]
profiles:
- build-only
# Main API service
pyexecutorhub-api:
build:
context: .
dockerfile: Dockerfile.api
container_name: pyexecutorhub-api
image: pyexecutorhub-api:latest
ports:
- "8001:8000"
volumes:
- .:/project:ro
- ./cron:/project/cron:rw
- ./config.yaml:/app/config.yaml:ro
- /var/run/docker.sock:/var/run/docker.sock
# Mount Docker binary and plugins for docker compose commands
- /usr/bin/docker:/usr/bin/docker:ro
- /usr/libexec/docker/cli-plugins:/usr/libexec/docker/cli-plugins:ro
# Example: Mount external scripts directory (if using external scripts)
# - /docker/scripts:/docker/scripts:ro
env_file:
- .env
environment:
- PYTHONUNBUFFERED=1
- PROJECT_DIR=/project
restart: unless-stopped
# Production resource configuration
deploy:
resources:
limits:
cpus: '0.5'
memory: 1G
reservations:
cpus: '0.25'
memory: 512M
# Security configuration
security_opt:
- no-new-privileges:true
read_only: false
tmpfs:
- /tmp:noexec,nosuid,size=100m