From 139bf7b94cdf07b1e91c5ddd6322256a2868ff3a Mon Sep 17 00:00:00 2001
From: Joel Savitz <jsavitz@redhat.com>
Date: Tue, 19 Mar 2024 15:01:47 -0400
Subject: [PATCH 1/2] add .dockerignore to mask any local build artifacts

Signed-off-by: Joel Savitz <jsavitz@redhat.com>
---
 orbit/.dockerignore      | 1 +
 pop/.dockerignore        | 1 +
 smtp/.dockerignore       | 1 +
 tcp_server/.dockerignore | 1 +
 4 files changed, 4 insertions(+)
 create mode 100644 orbit/.dockerignore
 create mode 100644 pop/.dockerignore
 create mode 100644 smtp/.dockerignore
 create mode 100644 tcp_server/.dockerignore

diff --git a/orbit/.dockerignore b/orbit/.dockerignore
new file mode 100644
index 00000000..1b30444a
--- /dev/null
+++ b/orbit/.dockerignore
@@ -0,0 +1 @@
+orbit.db
diff --git a/pop/.dockerignore b/pop/.dockerignore
new file mode 100644
index 00000000..7fffa4d8
--- /dev/null
+++ b/pop/.dockerignore
@@ -0,0 +1 @@
+pop
diff --git a/smtp/.dockerignore b/smtp/.dockerignore
new file mode 100644
index 00000000..ec2fc0fc
--- /dev/null
+++ b/smtp/.dockerignore
@@ -0,0 +1 @@
+smtp
diff --git a/tcp_server/.dockerignore b/tcp_server/.dockerignore
new file mode 100644
index 00000000..bf2fc123
--- /dev/null
+++ b/tcp_server/.dockerignore
@@ -0,0 +1 @@
+tcp_server

From 4f60e692b8116ae787b095131a63eedf9c55a534 Mon Sep 17 00:00:00 2001
From: Joel Savitz <jsavitz@redhat.com>
Date: Tue, 19 Mar 2024 15:32:09 -0400
Subject: [PATCH 2/2] Revert "orbit: switch production/dev toggle from
 environment to ARG"

This change broke the original feature, however the intention was
correct and the change will be made when the config.py is generated at
orbit build time. Using a .env file allowed this to work, however this
was done during local testing and therefore doesn't represent the status
quo of the master branch.

This reverts commit f668b0ebb11d1caf5abb948a8f111e3a2ee6e97f.
---
 container-compose-dev.yml     | 4 ++--
 container-compose-staging.yml | 4 ++--
 container-compose.yml         | 4 ++--
 orbit/Containerfile           | 3 ---
 4 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/container-compose-dev.yml b/container-compose-dev.yml
index 12d5ae09..1e292aaf 100644
--- a/container-compose-dev.yml
+++ b/container-compose-dev.yml
@@ -61,8 +61,6 @@ services:
       context: orbit
       dockerfile: Containerfile
       target: orbit
-      args:
-        - PRODUCTION: false
     security_opt:
       - label:disable
     volumes:
@@ -83,6 +81,8 @@ services:
         app_protocol: http
         mode: host
         name: "unencrypted http upstream server port"
+    environment:
+      - PRODUCTION=false
   smtp:
     build:
       context: smtp
diff --git a/container-compose-staging.yml b/container-compose-staging.yml
index dd37be06..72a2c7e4 100644
--- a/container-compose-staging.yml
+++ b/container-compose-staging.yml
@@ -53,8 +53,6 @@ services:
       context: orbit
       dockerfile: Containerfile
       target: orbit
-      args:
-        - PRODUCTION: false
     volumes:
       - type: bind
         source: ./.git
@@ -66,6 +64,8 @@ services:
         target: /orbit/docs
         read_only: true
         selinux: z
+    environment:
+      - PRODUCTION=false
     ports:
       - target: 9098
         published: 9098
diff --git a/container-compose.yml b/container-compose.yml
index 7802ea9a..bb66866e 100644
--- a/container-compose.yml
+++ b/container-compose.yml
@@ -53,8 +53,6 @@ services:
       context: orbit
       dockerfile: Containerfile
       target: orbit
-      args:
-        - PRODUCTION: true
     volumes:
       - type: bind
         source: ./.git
@@ -73,6 +71,8 @@ services:
         app_protocol: http
         mode: host
         name: "unencrypted http upstream server port"
+    environment:
+      - PRODUCTION=true
   smtp:
     build:
       context: smtp
diff --git a/orbit/Containerfile b/orbit/Containerfile
index 233fa288..3c805a21 100644
--- a/orbit/Containerfile
+++ b/orbit/Containerfile
@@ -33,7 +33,4 @@ COPY cgitrc /etc/cgitrc
 
 EXPOSE 9098
 
-ARG PRODUCTION
-ENV PRODUCTION=${PRODUCTION}
-
 CMD /bin/sh -c "source /radius-venv/bin/activate && uwsgi /orbit/radius.ini"
