Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .gitignore

This file was deleted.

45 changes: 0 additions & 45 deletions Dockerfile

This file was deleted.

26 changes: 26 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Use an official Python runtime as a parent image
FROM python:3.9-slim

# Set the working directory in the container
WORKDIR /

# Copy the dependencies file to the working directory
COPY requirements.txt .

# Install any needed dependencies specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Copy the content of the local src directory to the working directory
COPY . .

# Make port 8000 available to the world outside this container
EXPOSE 8000

# Define environment variable
ENV HOST=0.0.0.0
ENV PORT=8000
ENV PYTHONUNBUFFERED=1

# Run the command to start uvicorn
# Assuming your FastAPI app instance is named 'app' in 'main.py'
CMD ["python", "server.py"]
6 changes: 5 additions & 1 deletion init.sql → backend/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ CREATE TABLE IF NOT EXISTS parking_data (
timestamp TIMESTAMP NOT NULL
);

-- Load data from the mounted file
COPY parking_data (id,garage_name, garage_fullness, timestamp) FROM '/docker-entrypoint-initdb.d/initial-data.txt' WITH (FORMAT CSV);

---- Insert sample data
--INSERT INTO parking_data (garage_name, garage_fullness, timestamp) VALUES
--('North_Garage', '75% Full', '2023-05-01 08:00:00'),
Expand All @@ -18,4 +21,5 @@ CREATE TABLE IF NOT EXISTS parking_data (
--('South_Campus_Garage', '40% Full', '2023-05-01 09:00:00');

---- Verify the data
--SELECT * FROM parking_data;
-- select first 10 rows
SELECT * FROM parking_data LIMIT 10;
Loading