-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from vishalmhjn/dev
Add docker and minor fixes
- Loading branch information
Showing
9 changed files
with
133 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
src-deprecated/ | ||
aws-scripts/ | ||
|
||
!model_output/*.gitkeep | ||
# !*.gitkeep | ||
data/ | ||
.vscode | ||
*.log | ||
src/__pycache__ | ||
*.zip | ||
src/purge/ | ||
predictions/ | ||
.env | ||
src/artifacts/ | ||
docker | ||
**/.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,27 @@ | ||
# Use an official Python runtime as a parent image | ||
FROM python:3.12-slim | ||
# syntax=docker/dockerfile:1 | ||
|
||
# Set environment variables | ||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
ENV PYTHONUNBUFFERED 1 | ||
ARG PYTHON_VERSION=3.12.3 | ||
FROM python:${PYTHON_VERSION}-slim as base | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
# Prevents Python from writing pyc files | ||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
# Install build tools, including `make` | ||
RUN apt-get update && apt-get install -y build-essential make && rm -rf /var/lib/apt/lists/* | ||
WORKDIR /app | ||
|
||
# Copy the requirements file into the container at /app | ||
COPY requirements.txt /app/ | ||
# Install dependencies | ||
COPY requirements.txt . | ||
RUN python -m pip install -r requirements.txt | ||
|
||
# Install any dependencies in requirements.txt | ||
RUN pip install --upgrade pip && pip install -r requirements.txt | ||
# Copy the application files | ||
COPY . . | ||
|
||
# Copy the entire project directory into the container at /app | ||
COPY . /app/ | ||
RUN mkdir ./predictions | ||
RUN mkdir ./model_output | ||
|
||
# Expose the port the app runs on (5000 for Flask) | ||
# Expose the application port | ||
EXPOSE 5000 | ||
|
||
WORKDIR /app/src | ||
|
||
CMD ["sh", "-c", "python main.py -t -m knn && python app.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
version: '3.8' | ||
|
||
volumes: | ||
traffic-volume: | ||
name: "traffic-volume" | ||
driver: local | ||
|
||
services: | ||
traffic-app: | ||
image: traffic-image | ||
build: | ||
context: . | ||
ports: | ||
- "5000:5000" | ||
volumes: | ||
- traffic-volume:/app | ||
container_name: traffic-app | ||
stdin_open: true | ||
tty: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters