Skip to content

Modular logistics and supply chain operating system (LSOS)

added back httpd container to use `proxy_pass` to frankenphp/octane until nginx container can be removed from infra

Ronald A. Richardsonbd1a61912f9e
diff --git a/docker-bake.hcl b/docker-bake.hcl
index 7d04630d..0a31e1ba 100644
--- a/docker-bake.hcl
+++ b/docker-bake.hcl
@@ -5,7 +5,7 @@ variable "CACHE" { default = "" }
variable "GCP" { default = false }
group "default" {
- targets = ["app"]
+ targets = ["app", "app-httpd"]
}
target "app" {
@@ -35,3 +35,16 @@ target "app" {
cache-from = notequal("", CACHE) ? ["${CACHE}"] : []
cache-to = notequal("", CACHE) ? ["${CACHE},mode=max,ignore-error=true"] : []
}
+
+target "app-httpd" {
+ context = "./"
+ dockerfile = "docker/httpd/Dockerfile"
+ platforms = [
+ "linux/amd64",
+ ]
+
+ tags = notequal("", REGISTRY) ? formatlist(
+ GCP ? "${REGISTRY}/app-httpd:%s" : "${REGISTRY}:app-httpd-%s",
+ compact(["latest", VERSION])
+ ) : []
+}
\ No newline at end of file
diff --git a/docker-compose.yml b/docker-compose.yml
index e62326b8..1b00f231 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -71,4 +71,15 @@ services:
depends_on:
- database
- cache
- - queue
\ No newline at end of file
+ - queue
+
+ httpd:
+ volumes:
+ - ./api/storage:/var/www/html/api/storage
+ build:
+ context: .
+ dockerfile: docker/httpd/Dockerfile
+ ports:
+ - "8000:80"
+ depends_on:
+ - application
\ No newline at end of file
diff --git a/docker/httpd/Dockerfile b/docker/httpd/Dockerfile
new file mode 100644
index 00000000..5d26aca4
--- /dev/null
+++ b/docker/httpd/Dockerfile
@@ -0,0 +1,7 @@
+# alpine is more secure
+FROM nginx:stable-alpine
+
+ENV NGINX_APPLICATION_HOSTNAME application
+
+COPY docker/httpd/vhost.conf /etc/nginx/templates/default.conf.template
+COPY api/public/ /var/www/html/api/public/
\ No newline at end of file
diff --git a/docker/httpd/vhost.conf b/docker/httpd/vhost.conf
new file mode 100644
index 00000000..d4c8f866
--- /dev/null
+++ b/docker/httpd/vhost.conf
@@ -0,0 +1,46 @@
+server {
+ listen 80;
+ server_name localhost;
+ root /var/www/html/api/public;
+ # hide nginx version for security purposes
+ server_tokens off;
+ access_log /var/log/nginx/access.log;
+ error_log /var/log/nginx/error_log;
+ proxy_connect_timeout 600;
+ proxy_send_timeout 600;
+ proxy_read_timeout 600;
+ send_timeout 600;
+ index index.php;
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+ }
+
+ location /uploads {
+ alias /var/www/html/api/storage/app/uploads;
+ autoindex on;
+ try_files $uri $uri/ /index.php?$query_string;
+ }
+
+ location /storage {
+ alias /var/www/html/api/storage/app/public;
+ autoindex on;
+ try_files $uri $uri/ /index.php?$query_string;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_split_path_info ^(.+?\.php)(/.*)$;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ include fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ fastcgi_param PATH_INFO $fastcgi_path_info;
+ fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
+
+ # fastcgi_pass ${NGINX_APPLICATION_HOSTNAME}:9000;
+ proxy_pass ${NGINX_APPLICATION_HOSTNAME}:9000;
+ fastcgi_index index.php;
+ }
+}
\ No newline at end of file