Skip to content

Commit

Permalink
refactor(container): move app root out of /home
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaveman committed Jun 11, 2024
1 parent b46fc09 commit 4c09fee
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"dockerComposeFile": ["../compose.yml"],
"service": "dev",
"runServices": ["dev", "docs", "server"],
"workspaceFolder": "/home/calitp/app",
"workspaceFolder": "/calitp/app",
"postStartCommand": ["/bin/bash", "bin/reset_db.sh"],
"postAttachCommand": ["/bin/bash", ".devcontainer/postAttach.sh"],
"customizations": {
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/postAttach.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ set -eu

# initialize pre-commit

git config --global --add safe.directory /home/calitp/app
git config --global --add safe.directory /calitp/app
pre-commit install --overwrite
2 changes: 1 addition & 1 deletion appcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN python -m pip install --upgrade pip

# overwrite default nginx.conf
COPY appcontainer/nginx.conf /etc/nginx/nginx.conf
COPY appcontainer/proxy.conf /home/calitp/run/proxy.conf
COPY appcontainer/proxy.conf /calitp/run/proxy.conf

# copy source files
COPY manage.py manage.py
Expand Down
8 changes: 4 additions & 4 deletions appcontainer/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ http {
upstream app_server {
# fail_timeout=0 means we always retry an upstream even if it failed
# to return a good HTTP response
server unix:/home/calitp/run/gunicorn.sock fail_timeout=0;
server unix:/calitp/run/gunicorn.sock fail_timeout=0;
}

# maps $binary_ip_address to $limit variable if request is of type POST
Expand Down Expand Up @@ -67,7 +67,7 @@ http {

# path for static files
location /static/ {
alias /home/calitp/app/static/;
alias /calitp/app/static/;
expires 1y;
add_header Cache-Control public;
}
Expand All @@ -81,12 +81,12 @@ http {
# case-insensitive regex matches path
location ~* ^/(eligibility/confirm)$ {
limit_req zone=rate_limit;
include /home/calitp/run/proxy.conf;
include /calitp/run/proxy.conf;
}

# app path
location @proxy_to_app {
include /home/calitp/run/proxy.conf;
include /calitp/run/proxy.conf;
}
}
}
4 changes: 2 additions & 2 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ services:
ports:
- "${DJANGO_LOCAL_PORT:-8000}:8000"
volumes:
- ./:/home/calitp/app
- ./:/calitp/app

docs:
image: benefits_client:dev
Expand All @@ -32,7 +32,7 @@ services:
ports:
- "8001"
volumes:
- ./:/home/calitp/app
- ./:/calitp/app

server:
image: ghcr.io/cal-itp/eligibility-server:dev
Expand Down
2 changes: 1 addition & 1 deletion terraform/app_service.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ resource "azurerm_service_plan" "main" {
}

locals {
data_mount = "/home/calitp/app/data"
data_mount = "/calitp/app/data"
}

resource "azurerm_linux_web_app" "main" {
Expand Down

0 comments on commit 4c09fee

Please sign in to comment.