Browse Source

add docker

Tuan Nguyen 1 năm trước cách đây
mục cha
commit
4d29450358
4 tập tin đã thay đổi với 39 bổ sung2 xóa
  1. 5 0
      .gitignore
  2. 20 0
      Dockerfile
  3. 11 0
      docker-compose.yml
  4. 3 2
      requirements.txt

+ 5 - 0
.gitignore

@@ -0,0 +1,5 @@
+gcode_files/
+__pycache__/
+*.pyc
+*.pyo
+.env

+ 20 - 0
Dockerfile

@@ -0,0 +1,20 @@
+# Use an official Python runtime as a parent image
+FROM python:3.9-slim
+
+# Set the working directory in the container
+WORKDIR /app
+
+# Copy the current directory contents into the container at /app
+COPY . /app
+
+# Install any needed packages specified in requirements.txt
+RUN pip install --no-cache-dir -r requirements.txt
+
+# Expose the port the app runs on
+EXPOSE 8080
+
+# Define environment variable
+ENV FLASK_ENV=development
+
+# Run the command to start the app
+CMD ["python", "theta_rho_app.py"]

+ 11 - 0
docker-compose.yml

@@ -0,0 +1,11 @@
+version: '3.8'
+services:
+  flask-app:
+    build: .
+    ports:
+      - "8080:8080" # Map port 8080 of the container to 8080 of the host
+    volumes:
+      - ./theta_rho_files:/app/theta_rho_files # Map host folder to container folder
+    environment:
+      - FLASK_ENV=development # Set environment variables for Flask
+    container_name: flask-theta-rho-app

+ 3 - 2
requirements.txt

@@ -1,3 +1,4 @@
 flask
-flask-socketio
-pyserial
+pyserial
+numpy
+svgpathtools