Skip to content

Commit

Permalink
lando: add lando functionality (bug 1885346)
Browse files Browse the repository at this point in the history
- remove docker compose files for lando-ui and lando-api
- add docker compose file for lando
- update main docker compose file
- remove docker subdirectories that are no longer needed
- update nginx site.conf file with new lando configuration
  • Loading branch information
zzzeid committed May 2, 2024
1 parent e2e7027 commit 5e51976
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 192 deletions.
70 changes: 0 additions & 70 deletions docker-compose.lando-api.yml

This file was deleted.

21 changes: 0 additions & 21 deletions docker-compose.lando-ui.yml

This file was deleted.

46 changes: 46 additions & 0 deletions docker-compose.lando.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
version: '3.4'
services:
lando:
user: "${UID}:${GID}"
build:
context: ../lando/.
image: suite_lando
stdin_open: true
tty: true
command: bash -c "
lando migrate &&
lando collectstatic --no-input &&
lando runserver 0.0.0.0:80"
env_file:
- ../lando/.env
volumes:
- ../lando:/code
- ../lando/staticfiles:/staticfiles
- ../lando-prorotype/media:/mediafiles
depends_on:
lando.db:
condition: service_healthy
lando.test:
build: ../lando/nginx
ports:
- 443:443
depends_on:
- lando
volumes:
- ../lando/staticfiles:/staticfiles
- ../lando/media:/mediafiles
lando.db:
image: postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres", "-d", "postgres"]
interval: 10s
timeout: 20s
retries: 5

volumes:
media:
109 changes: 23 additions & 86 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,87 +110,35 @@ services:
#########################
# Lando Containers
#########################

lando-ui:
image: mozilla/landoui:latest
lando:
user: "${UID}:${GID}"
image: mozilla/lando:latest # TODO: this does not exist yet.
env_file:
- ../lando/.env
environment:
DEFAULT_DB_HOST: lando.db
DEBUG: 1
ENV: localdev
HOST: 0.0.0.0
LANDO_API_OIDC_IDENTIFIER: http://lando-api.test
LANDO_API_URL: http://lando-api.test
PORT: 9000
SECRET_KEY: secret_key_change_me
SENTRY_DSN:
SESSION_COOKIE_DOMAIN: lando-ui.test
SESSION_COOKIE_NAME: lando-ui.test
SESSION_COOKIE_SECURE: 0
USE_HTTPS: 0
UWSGI_HTTP: :9000
UWSGI_SOCKET: :9001
VERSION_PATH: /version.json

lando-api:
image: mozilla/landoapi:latest
environment:
OIDC_IDENTIFIER: http://lando-api.test
LOCALDEV_MOCK_AUTH0_USER: inject_valid # [default / inject_invalid]
DATABASE_URL: postgresql://postgres:[email protected]/postgres
ENV: localdev
HOST_URL: http://lando-api.test
LANDO_UI_URL: http://lando-ui.test
PINGBACK_ENABLED: y
PINGBACK_HOST_URL: http://lando-api.test
ENVIRONMENT: localdev
PHABRICATOR_URL: http://phabricator.test
PHABRICATOR_UNPRIVILEGED_API_KEY: api-lefsv24henzsbzpw337bhizawuyh
TRANSPLANT_URL: http://transplant-api.test/
TRANSPLANT_USERNAME: autoland
TRANSPLANT_PASSWORD: autoland
TRANSPLANT_API_KEY: autoland
SENTRY_DSN:
UWSGI_HTTP: :9000
UWSGI_SOCKET: :9001
depends_on:
- lando-api.db
lando.db:
condition: service_healthy

lando-api.db:
platform: linux/x86_64
image: postgres:14
lando.db:
image: postgres:16
environment:
POSTGRES_PASSWORD: password
POSTGRES_USER: postgres
volumes:
- lando-postgres-db:/var/lib/postgresql/data
POSTGRES_PASSWORD: postgres
ports:
- "54322:5432"

lando-api.landing-worker:
build:
context: ../lando-api/
dockerfile: ./Dockerfile
image: suite_lando-api
command: ["landing-worker"]
environment:
- ENV=localdev
- DATABASE_URL=postgresql://postgres:[email protected]/postgres
- SENTRY_DSN=
- CELERY_BROKER_URL=redis://redis.queue/0
- OIDC_IDENTIFIER=https://lando-api.test
- LANDO_UI_URL=https://lando.test
- REPO_CLONES_PATH=/repos
- REPOS_TO_LAND=first-repo
- 5432:5432
volumes:
- ../lando-api:/app
- ../lando-api/migrations:/migrations
# Prevent writing python cache to the host.
- caches_cache:/app/.cache/
depends_on:
- lando-api.db
- redis.queue

redis.queue:
image: redis:3.2-alpine

- lando-postgres-db:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres", "-d", "postgres"]
interval: 10s
timeout: 20s
retries: 5

###############################
# Phabricator Containers
Expand Down Expand Up @@ -304,26 +252,15 @@ services:
- phabricator
- tinyproxy

lando-ui.test:
platform: linux/x86_64
image: nginx:alpine
container_name: lando-ui.test
volumes:
- ./docker/landoui/site.conf:/etc/nginx/conf.d/default.conf:ro
restart: on-failure
depends_on:
- lando-ui
- tinyproxy

lando-api.test:
lando.test:
platform: linux/x86_64
image: nginx:alpine
container_name: lando-api.test
container_name: lando.test
volumes:
- ./docker/landoapi/site.conf:/etc/nginx/conf.d/default.conf:ro
- ./docker/lando/site.conf:/etc/nginx/conf.d/default.conf:ro
restart: on-failure
depends_on:
- lando-api
- lando
- tinyproxy

autoland.hg.test:
Expand Down
29 changes: 29 additions & 0 deletions docker/lando/site.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
server {

listen 443 ssl;
server_name localhost;

ssl_certificate /ssl/certificate.crt;
ssl_certificate_key /ssl/private.key;
ssl_session_cache shared:SSL:20m;
ssl_session_timeout 180m;
ssl_protocols TLSv1.2;

client_max_body_size 20M;


location / {
proxy_pass http://lando;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
}

location /static {
alias /staticfiles/;
}

location /media {
alias /mediafiles/;
}
}
8 changes: 0 additions & 8 deletions docker/landoapi/site.conf

This file was deleted.

7 changes: 0 additions & 7 deletions docker/landoui/site.conf

This file was deleted.

0 comments on commit 5e51976

Please sign in to comment.