Microservie docker update
This commit is contained in:
@ -12,8 +12,8 @@ COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt \
|
||||
--timeout=100 || pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Copy application code
|
||||
COPY . .
|
||||
# Copy application code - MUST include microservice.py
|
||||
COPY microservice.py .
|
||||
|
||||
ENV FLASK_ENV=production
|
||||
ENV FLASK_APP=microservice.py
|
||||
@ -22,4 +22,5 @@ ENV FLASK_RUN_PORT=5001
|
||||
|
||||
EXPOSE 5001
|
||||
|
||||
CMD ["gunicorn", "--bind", "0.0.0.0:5001", "--workers", "2", "--timeout", "120", "microservice:app"]
|
||||
# Use python -m to run the module directly
|
||||
CMD ["python", "-m", "gunicorn", "--bind", "0.0.0.0:5001", "--workers", "2", "--timeout", "120", "microservice:app"]
|
||||
@ -63,12 +63,13 @@ services:
|
||||
ports:
|
||||
- "8088:5001"
|
||||
volumes:
|
||||
- ./Microservice:/app
|
||||
- ./Project:/app
|
||||
networks:
|
||||
- vending-network
|
||||
environment:
|
||||
- MAIN_BACKEND_URL=https://iotbackend.rootxwire.com
|
||||
- FLASK_ENV=production
|
||||
- PYTHONPATH=/app
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: ["CMD", "python", "-c", "import requests; requests.get('http://localhost:5001/', timeout=5)"]
|
||||
|
||||
Reference in New Issue
Block a user