← azuredeploy

Dockerfiles

4861ab790cf39076bcbe7c41a0b71b87e9e5398f · ovidiucs · Mar 6, 2024 00:00

+48 −1 · 6 files changed

  • {container => codefiles/container}/Dockerfile +0 −0
  • {container => codefiles/container}/README.md +0 −0
  • container/primary/Dockerfile => codefiles/container/primary/Dockerfile.primary +1 −1
  • container/secondary/Dockerfile => codefiles/container/secondary/Dockerfile.secondary +0 −0
  • codefiles/src/Dockerfile.primary +23 −0
  • codefiles/src/Dockerfile.secondary +24 −0
diff --git a/container/Dockerfile b/codefiles/container/Dockerfile
similarity index 100%
rename from container/Dockerfile
rename to codefiles/container/Dockerfile
diff --git a/container/README.md b/codefiles/container/README.md
similarity index 100%
rename from container/README.md
rename to codefiles/container/README.md
diff --git a/container/primary/Dockerfile b/codefiles/container/primary/Dockerfile.primary
similarity index 94%
rename from container/primary/Dockerfile
rename to codefiles/container/primary/Dockerfile.primary
index 377198b..66e43e2 100644
--- a/container/primary/Dockerfile
+++ b/codefiles/container/primary/Dockerfile.primary
@@ -5,7 +5,7 @@ FROM python:3.8-slim
 WORKDIR /app
 
 # Copy the current directory contents into the container at /app
-COPY ../../codefiles/src/primary /app
+COPY ../../primary /app
 
 # Install any needed packages specified in requirements.txt
 # Assuming you might have a requirements.txt for any Python dependencies
diff --git a/container/secondary/Dockerfile b/codefiles/container/secondary/Dockerfile.secondary
similarity index 100%
rename from container/secondary/Dockerfile
rename to codefiles/container/secondary/Dockerfile.secondary
diff --git a/codefiles/src/Dockerfile.primary b/codefiles/src/Dockerfile.primary
new file mode 100644
index 0000000..8aec9dc
--- /dev/null
+++ b/codefiles/src/Dockerfile.primary
@@ -0,0 +1,23 @@
+# Use an official Python runtime as a parent image
+FROM python:3.8-slim
+
+# Set the working directory in the container
+WORKDIR /app
+
+# Copy the current directory contents into the container at /app
+COPY ./primary /app
+
+# Install any needed packages specified in requirements.txt
+# Assuming you might have a requirements.txt for any Python dependencies
+# For this example, it's likely empty but included for completeness
+#COPY requirements.txt /app
+#RUN pip install --no-cache-dir -r requirements.txt
+
+# Make port 12345 available to the world outside this container
+EXPOSE 12345
+
+# Define environment variable
+ENV NAME Primary
+
+# Run primary.py when the container launches
+CMD ["python", "primary.py"]
diff --git a/codefiles/src/Dockerfile.secondary b/codefiles/src/Dockerfile.secondary
new file mode 100644
index 0000000..d10a66b
--- /dev/null
+++ b/codefiles/src/Dockerfile.secondary
@@ -0,0 +1,24 @@
+# Use an official Python runtime as a parent image
+FROM python:3.8-slim
+
+# Set the working directory in the container
+WORKDIR /app
+
+# Copy the current directory contents into the container at /app
+COPY ./secondary /app
+
+# Install any needed packages specified in requirements.txt
+# Assuming you might have a requirements.txt for any Python dependencies
+# For this example, it's likely empty but included for completeness
+#COPY requirements.txt /app
+#RUN pip install --no-cache-dir -r requirements.txt
+
+# Make port 23456 available to the world outside this container
+EXPOSE 23456
+
+# Define environment variable
+ENV NAME Secondary
+
+# Run secondary.py when the container launches
+CMD ["python", "secondary.py"]
+