Skip to content

Commit

Permalink
fix: Add initial support for scaling the Lambda runtime.
Browse files Browse the repository at this point in the history
  • Loading branch information
skyzyx committed Jan 9, 2025
1 parent 3993375 commit c1e2e22
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .hadolint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
ignored:
# Specify version with `dnf install -y <package>-<version>`.
# This is for local development only. It's fine.
- DL3041

# "Multiple consecutive `RUN` instructions. Consider consolidation."
# We've learned to love the layer cache. Considered and disregarded.
- DL3059
Expand Down
48 changes: 47 additions & 1 deletion localdev/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
services:
lambda:
# Name of the container when it is running.
container_name: localdev-lambda
# container_name: localdev-lambda

# Instructions which tell BuildKit how to build the image, passing secrets
# SECURELY to the Dockerfile.
Expand All @@ -14,6 +14,10 @@ services:

depends_on:
- cache
- traefik

# Run multiple copies of this container.
scale: 1

# Set shared memory limit when using `docker compose`.
shm_size: 128mb
Expand Down Expand Up @@ -61,6 +65,48 @@ services:
extra_hosts:
- host.docker.internal:host-gateway

labels:
- "traefik.http.routers.lambda.rule=Host(`lambda.docker.localhost`)"

traefik:
# Name of the container when it is running.
container_name: localdev-traefik

# Instructions which tell BuildKit how to build the image, passing secrets
# SECURELY to the Dockerfile.
image: traefik:3

# Enables the web UI and tells Traefik to listen to docker
command:
#- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entryPoints.web.address=:8081"

# Set shared memory limit when using `docker compose`.
shm_size: 512mb

# Stay running. Restart on failure.
restart: always

# Basic Linux-y and permission stuff.
privileged: true
pid: host
sysctls:
net.core.somaxconn: 1024

# Connect persistent volumes to the container.
volumes:
# So that Traefik can listen to the Docker events
- "/var/run/docker.sock:/var/run/docker.sock:ro"

# Inside, the container runs on port 808x. We want to expose the same port
# number on the host.
ports:
- 8081:8081
- 8082:8080 # Traefik's web UI, enabled by --api

cache:
# Name of the container when it is running.
container_name: localdev-valkey
Expand Down

0 comments on commit c1e2e22

Please sign in to comment.