Skip to content

Commit 5fb66aa

Browse files
committed
chore(docker): compose cleanup
- added healtchecks to all relevant services - dex sqlite3 storage - db volume to preserve storage - runner and api correct ssh gateway env vars - expose jaeger, minio and maildev ports Signed-off-by: Toma Puljak <[email protected]>
1 parent 043f89b commit 5fb66aa

File tree

13 files changed

+106
-152
lines changed

13 files changed

+106
-152
lines changed

.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ docker
1616
libs/sdk-python
1717
libs/sdk-typescript
1818
libs/api-client-python
19-
libs/api-client-python-async
19+
libs/api-client-python-async
20+
Dockerfile

apps/api/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ CRON_TIMEZONE=
7373

7474
SSH_GATEWAY_API_KEY=ssh_secret_api_token
7575
SSH_GATEWAY_COMMAND="ssh -p 2222 {{TOKEN}}@localhost"
76-
SSH_GATEWAY_PUBLIC_KEY="c3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCQVFDNzRzbkszOHEvcFdKcGtIcU9jazlMbnNXbG5ZV1B0WGgvL21vcHJybExLa05sWmcrdzV5SWVjTTdETm1WUXhIQjZ1SnNhdVRYZHRoMkJYZVJuSkt3K0FKYVVNYjA2YTZtaUxkbnJmSVRacktqNzlBQXNnSHVxd0ltcExycUcrZjE3UVhUSEhScWRCWUVZNFNSY3VBSDY3aEhueUg4YVo4THRmbjBNTWY2WWFncG9uZlhNeGdCcXZYbTNqZThLbHRzeWhnR2R5WmlTUlBZekxHb0t6Ni9veHR5MTkwQTByZy9HdXlBVlpIaVFyZzdOeHZhVFJVSGZpRWZBdlhST2tRZDNidWZ3QjY0UXc0OFFmNjBUd3FrVnBrYXdMbjlsWkJoSDZDa0xzZWJsbytCbm5lT3JBMElGMW1UTWxqbnB3OHZJZStISzdINWUwTnE5ZUVrZElTVGQgc3NoLWdhdGV3YXktaG9zdC1rZXk="
76+
SSH_GATEWAY_PUBLIC_KEY="c3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCZ1FEZUtocFdOYVhVNkpSMnJXekc1NlZJeksrcmsrdForcCtVUmwyeWF5cWRnZGg2bnVOL1NtVnJsYmV4MGlrRVZZemdRWUIwWno5M2dqOVhxSkd4WjJiMHVoSDFzNkp2bnhKZVdIK05rbjBNMzRiRjZkeVloZ3o4M0JaTitWcElJdnVDT1pxYWE4VnlRWjhPdjVLMU00enlmQnFCMld3ejcwZEVWUnFaMnVZckd5U0RqUUIrU3hRQ3phY0djb2JRQTFUd2QxdEJvSk5BaVpPWXFSU3d6TmNoTk5hZHlxSHRGdkZRQ0hhNjZWaVBmQ0FVUGt2cEN6ZGh3TmJGdVhGVWkxbnZOWkx4M056RU41M05LWUhZcWU3Y3dXZkI4QjBoRDhDd3hmSDd6T0o1b1RCMnBMVVlsUWpZRDNsN3k4SkFTbDZpYkpuR1A1SWczVXpZWlRIdUdkNzVXWktnNTRJTVROQlFPMWpJdE9HL0orUm1XbzB0YTdpRkF6ZExyL1BmbDdXTVMwbEZhSm9scTdUVmJLUG1JODFTOU04VEgrbXhLbGZ5b2NqZzhwSUdlQUllcEo3dXl1Vk1xT2wxeVVuSFNycDRlVEVlR0k3NlpCOFRoUzhkYnBLUTIvb2RYMHkwc3FSZDI0Y2lGdnM0dnZVaW80NFdYNlNWRG54dXpWRHc1Rzg9IGRheXRvbmFAMDQwNjZiZDIwY2Vi"
7777

7878
PROXY_TEMPLATE_URL=http://{{PORT}}-{{sandboxId}}.proxy.localhost:4000
7979

apps/api/Dockerfile

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM docker:28.2.2-dind-alpine3.22 AS daytona
22

33
# Install nodejs
4-
RUN apk --update add --no-cache nodejs=22.16.0-r2 npm bash
4+
RUN apk --update add --no-cache nodejs=22.16.0-r2 npm bash curl
55
RUN npm install -g corepack && corepack enable
66

77
WORKDIR /daytona
@@ -41,7 +41,7 @@ ENV OIDC_MANAGEMENT_API_CLIENT_ID=
4141
ENV OIDC_MANAGEMENT_API_CLIENT_SECRET=
4242
ENV OIDC_MANAGEMENT_API_AUDIENCE=
4343

44-
ENV DEFAULT_SNAPSHOT=ubuntu:22.04
44+
ENV DEFAULT_SNAPSHOT=daytonaio/sandbox:0.5.0
4545
ENV DASHBOARD_URL=http://localhost:3000/dashboard
4646
ENV DASHBOARD_BASE_API_URL=http://localhost:3000
4747

@@ -99,9 +99,25 @@ ENV DEFAULT_RUNNER_CAPACITY=100
9999
ENV DEFAULT_RUNNER_REGION=us
100100
ENV DEFAULT_RUNNER_CLASS=small
101101

102+
ENV DEFAULT_ORG_QUOTA_TOTAL_CPU_QUOTA=10000
103+
ENV DEFAULT_ORG_QUOTA_TOTAL_MEMORY_QUOTA=10000
104+
ENV DEFAULT_ORG_QUOTA_TOTAL_DISK_QUOTA=100000
105+
ENV DEFAULT_ORG_QUOTA_MAX_CPU_PER_SANDBOX=100
106+
ENV DEFAULT_ORG_QUOTA_MAX_MEMORY_PER_SANDBOX=100
107+
ENV DEFAULT_ORG_QUOTA_MAX_DISK_PER_SANDBOX=1000
108+
ENV DEFAULT_ORG_QUOTA_SNAPSHOT_QUOTA=1000
109+
ENV DEFAULT_ORG_QUOTA_MAX_SNAPSHOT_SIZE=1000
110+
ENV DEFAULT_ORG_QUOTA_VOLUME_QUOTA=10000
111+
102112
ENV SSH_GATEWAY_API_KEY=ssh_secret_api_token
103113
ENV SSH_GATEWAY_COMMAND="ssh -p 2222 {{TOKEN}}@localhost"
114+
ENV SSH_GATEWAY_PUBLIC_KEY="c3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCZ1FEZUtocFdOYVhVNkpSMnJXekc1NlZJeksrcmsrdForcCtVUmwyeWF5cWRnZGg2bnVOL1NtVnJsYmV4MGlrRVZZemdRWUIwWno5M2dqOVhxSkd4WjJiMHVoSDFzNkp2bnhKZVdIK05rbjBNMzRiRjZkeVloZ3o4M0JaTitWcElJdnVDT1pxYWE4VnlRWjhPdjVLMU00enlmQnFCMld3ejcwZEVWUnFaMnVZckd5U0RqUUIrU3hRQ3phY0djb2JRQTFUd2QxdEJvSk5BaVpPWXFSU3d6TmNoTk5hZHlxSHRGdkZRQ0hhNjZWaVBmQ0FVUGt2cEN6ZGh3TmJGdVhGVWkxbnZOWkx4M056RU41M05LWUhZcWU3Y3dXZkI4QjBoRDhDd3hmSDd6T0o1b1RCMnBMVVlsUWpZRDNsN3k4SkFTbDZpYkpuR1A1SWczVXpZWlRIdUdkNzVXWktnNTRJTVROQlFPMWpJdE9HL0orUm1XbzB0YTdpRkF6ZExyL1BmbDdXTVMwbEZhSm9scTdUVmJLUG1JODFTOU04VEgrbXhLbGZ5b2NqZzhwSUdlQUllcEo3dXl1Vk1xT2wxeVVuSFNycDRlVEVlR0k3NlpCOFRoUzhkYnBLUTIvb2RYMHkwc3FSZDI0Y2lGdnM0dnZVaW80NFdYNlNWRG54dXpWRHc1Rzg9IGRheXRvbmFAMDQwNjZiZDIwY2Vi"
115+
116+
ENV RUNNER_DECLARATIVE_BUILD_SCORE_THRESHOLD=10
117+
ENV RUNNER_AVAILABILITY_SCORE_THRESHOLD=10
104118

105119
ENV RUN_MIGRATIONS=true
106120

121+
HEALTHCHECK CMD [ "curl", "-f", "http://localhost:3000/api/config" ]
122+
107123
ENTRYPOINT ["sh", "-c", "dockerd-entrypoint.sh & node dist/apps/api/main.js"]

apps/docs/src/content/docs/en/oss-deployment.mdx

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -174,21 +174,20 @@ Below is a full list of environment variables with their default values:
174174

175175
### Runner
176176

177-
| Variable | Type | Default Value | Description |
178-
| -------------------------- | ------- | -------------------------------------------- | ------------------------------------- |
179-
| `VERSION` | string | `0.0.1` | Runner service version |
180-
| `ENVIRONMENT` | string | `development` | Application environment |
181-
| `API_PORT` | number | `3003` | Runner API service port |
182-
| `API_TOKEN` | string | `secret_api_token` | Runner API authentication token |
183-
| `DAYTONA_BINARY_PATH` | string | `/workspaces/daytona/dist/apps/daemon-amd64` | Path to Daytona daemon binary |
184-
| `LOG_FILE_PATH` | string | `/home/daytona/runner/runner.log` | Path to runner log file |
185-
| `RESOURCE_LIMITS_DISABLED` | boolean | `true` | Disable resource limits for sandboxes |
186-
| `AWS_ENDPOINT_URL` | string | `http://minio:9000` | AWS S3-compatible storage endpoint |
187-
| `AWS_REGION` | string | `us-east-1` | AWS region |
188-
| `AWS_ACCESS_KEY_ID` | string | `minioadmin` | AWS access key ID |
189-
| `AWS_SECRET_ACCESS_KEY` | string | `minioadmin` | AWS secret access key |
190-
| `AWS_DEFAULT_BUCKET` | string | `daytona` | AWS default bucket name |
191-
| `SERVER_URL` | string | `http://api:3000/api` | Daytona API server URL |
177+
| Variable | Type | Default Value | Description |
178+
| -------------------------- | ------- | --------------------------------- | ------------------------------------- |
179+
| `VERSION` | string | `0.0.1` | Runner service version |
180+
| `ENVIRONMENT` | string | `development` | Application environment |
181+
| `API_PORT` | number | `3003` | Runner API service port |
182+
| `API_TOKEN` | string | `secret_api_token` | Runner API authentication token |
183+
| `LOG_FILE_PATH` | string | `/home/daytona/runner/runner.log` | Path to runner log file |
184+
| `RESOURCE_LIMITS_DISABLED` | boolean | `true` | Disable resource limits for sandboxes |
185+
| `AWS_ENDPOINT_URL` | string | `http://minio:9000` | AWS S3-compatible storage endpoint |
186+
| `AWS_REGION` | string | `us-east-1` | AWS region |
187+
| `AWS_ACCESS_KEY_ID` | string | `minioadmin` | AWS access key ID |
188+
| `AWS_SECRET_ACCESS_KEY` | string | `minioadmin` | AWS secret access key |
189+
| `AWS_DEFAULT_BUCKET` | string | `daytona` | AWS default bucket name |
190+
| `SERVER_URL` | string | `http://api:3000/api` | Daytona API server URL |
192191

193192
### SSH Gateway
194193

apps/proxy/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,6 @@ ENV OIDC_AUDIENCE=daytona
4141
ENV REDIS_HOST=redis
4242
ENV REDIS_PORT=6379
4343

44+
HEALTHCHECK CMD [ "curl", "-f", "http://localhost:4000/health" ]
45+
4446
ENTRYPOINT ["daytona-proxy"]

apps/runner/.env

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ API_TOKEN=secret_api_token
66

77
DAYTONA_BINARY_URL=https://daytona.io/daytona
88
TERMINAL_BINARY_URL=https://daytona-ai-saas-stage.s3.us-east-1.amazonaws.com/term
9-
DAYTONA_BINARY_PATH=/workspaces/daytona/dist/apps/daemon-amd64
109
TERMINAL_BINARY_PATH=/workspaces/daytona/.tmp/binaries/terminal
1110
LOG_FILE_PATH=/home/daytona/runner/runner.log
1211

@@ -19,6 +18,6 @@ AWS_DEFAULT_BUCKET=daytona
1918
LOG_LEVEL=debug
2019

2120
SSH_GATEWAY_ENABLE=true
22-
SSH_PUBLIC_KEY="c3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCQVFDNzRzbkszOHEvcFdKcGtIcU9jazlMbnNXbG5ZV1B0WGgvL21vcHJybExLa05sWmcrdzV5SWVjTTdETm1WUXhIQjZ1SnNhdVRYZHRoMkJYZVJuSkt3K0FKYVVNYjA2YTZtaUxkbnJmSVRacktqNzlBQXNnSHVxd0ltcExycUcrZjE3UVhUSEhScWRCWUVZNFNSY3VBSDY3aEhueUg4YVo4THRmbjBNTWY2WWFncG9uZlhNeGdCcXZYbTNqZThLbHRzeWhnR2R5WmlTUlBZekxHb0t6Ni9veHR5MTkwQTByZy9HdXlBVlpIaVFyZzdOeHZhVFJVSGZpRWZBdlhST2tRZDNidWZ3QjY0UXc0OFFmNjBUd3FrVnBrYXdMbjlsWkJoSDZDa0xzZWJsbytCbm5lT3JBMElGMW1UTWxqbnB3OHZJZStISzdINWUwTnE5ZUVrZElTVGQgc3NoLWdhdGV3YXktaG9zdC1rZXk="
21+
SSH_PUBLIC_KEY="c3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCZ1FEZUtocFdOYVhVNkpSMnJXekc1NlZJeksrcmsrdForcCtVUmwyeWF5cWRnZGg2bnVOL1NtVnJsYmV4MGlrRVZZemdRWUIwWno5M2dqOVhxSkd4WjJiMHVoSDFzNkp2bnhKZVdIK05rbjBNMzRiRjZkeVloZ3o4M0JaTitWcElJdnVDT1pxYWE4VnlRWjhPdjVLMU00enlmQnFCMld3ejcwZEVWUnFaMnVZckd5U0RqUUIrU3hRQ3phY0djb2JRQTFUd2QxdEJvSk5BaVpPWXFSU3d6TmNoTk5hZHlxSHRGdkZRQ0hhNjZWaVBmQ0FVUGt2cEN6ZGh3TmJGdVhGVWkxbnZOWkx4M056RU41M05LWUhZcWU3Y3dXZkI4QjBoRDhDd3hmSDd6T0o1b1RCMnBMVVlsUWpZRDNsN3k4SkFTbDZpYkpuR1A1SWczVXpZWlRIdUdkNzVXWktnNTRJTVROQlFPMWpJdE9HL0orUm1XbzB0YTdpRkF6ZExyL1BmbDdXTVMwbEZhSm9scTdUVmJLUG1JODFTOU04VEgrbXhLbGZ5b2NqZzhwSUdlQUllcEo3dXl1Vk1xT2wxeVVuSFNycDRlVEVlR0k3NlpCOFRoUzhkYnBLUTIvb2RYMHkwc3FSZDI0Y2lGdnM0dnZVaW80NFdYNlNWRG54dXpWRHc1Rzg9IGRheXRvbmFAMDQwNjZiZDIwY2Vi"
2322

2423
SSH_HOST_KEY_PATH=/workspaces/daytona/tmp/runner/id_rsa

apps/runner/Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ RUN SKIP_COMPUTER_USE_BUILD=true yarn nx build runner --configuration=production
1919

2020
FROM docker:28.2.2-dind-alpine3.22 AS runner
2121

22+
RUN apk add --no-cache curl
23+
2224
WORKDIR /usr/local/bin
2325

2426
COPY --from=build /daytona/dist/apps/runner daytona-runner
@@ -32,7 +34,6 @@ ENV ENVIRONMENT=development
3234
ENV API_PORT=3003
3335
ENV API_TOKEN=secret_api_token
3436

35-
ENV DAYTONA_BINARY_PATH=/workspaces/daytona/dist/apps/daemon-amd64
3637
ENV LOG_FILE_PATH=/home/daytona/runner/runner.log
3738

3839
ENV RESOURCE_LIMITS_DISABLED=true
@@ -45,4 +46,9 @@ ENV AWS_DEFAULT_BUCKET=daytona
4546

4647
ENV SERVER_URL=http://api:3000/api
4748

48-
ENTRYPOINT ["sh", "-c", "dockerd & daytona-runner"]
49+
ENV SSH_GATEWAY_ENABLE=true
50+
ENV SSH_PUBLIC_KEY="c3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCZ1FEZUtocFdOYVhVNkpSMnJXekc1NlZJeksrcmsrdForcCtVUmwyeWF5cWRnZGg2bnVOL1NtVnJsYmV4MGlrRVZZemdRWUIwWno5M2dqOVhxSkd4WjJiMHVoSDFzNkp2bnhKZVdIK05rbjBNMzRiRjZkeVloZ3o4M0JaTitWcElJdnVDT1pxYWE4VnlRWjhPdjVLMU00enlmQnFCMld3ejcwZEVWUnFaMnVZckd5U0RqUUIrU3hRQ3phY0djb2JRQTFUd2QxdEJvSk5BaVpPWXFSU3d6TmNoTk5hZHlxSHRGdkZRQ0hhNjZWaVBmQ0FVUGt2cEN6ZGh3TmJGdVhGVWkxbnZOWkx4M056RU41M05LWUhZcWU3Y3dXZkI4QjBoRDhDd3hmSDd6T0o1b1RCMnBMVVlsUWpZRDNsN3k4SkFTbDZpYkpuR1A1SWczVXpZWlRIdUdkNzVXWktnNTRJTVROQlFPMWpJdE9HL0orUm1XbzB0YTdpRkF6ZExyL1BmbDdXTVMwbEZhSm9scTdUVmJLUG1JODFTOU04VEgrbXhLbGZ5b2NqZzhwSUdlQUllcEo3dXl1Vk1xT2wxeVVuSFNycDRlVEVlR0k3NlpCOFRoUzhkYnBLUTIvb2RYMHkwc3FSZDI0Y2lGdnM0dnZVaW80NFdYNlNWRG54dXpWRHc1Rzg9IGRheXRvbmFAMDQwNjZiZDIwY2Vi"
51+
52+
HEALTHCHECK CMD [ "curl", "-f", "http://localhost:3003/" ]
53+
54+
ENTRYPOINT ["sh", "-c", "/usr/local/bin/dockerd-entrypoint.sh & daytona-runner"]

0 commit comments

Comments
 (0)