Compare commits
3 Commits
feat/refac
...
feat/readm
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d97a9ef01c | ||
|
|
be2b2ecbac | ||
|
|
e8ab6cf69d |
@@ -1 +1 @@
|
|||||||
../../.github/workflows/build.yml
|
.github/workflows/build.yml
|
||||||
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -4,13 +4,11 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- master
|
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'v*'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- master
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
|||||||
71
README.md
71
README.md
@@ -1,3 +1,70 @@
|
|||||||
# pi-mta-sign
|
# Pi MTA Sign!
|
||||||
|
|
||||||
Code and documentation for project for turning a raspberry pi into your very own MTA subway sign.
|
This project gives you a docker image that you can run locally to pull MTA data and self-host a webpage that looks very
|
||||||
|
similar to the classic MTA Signs found in the metro.
|
||||||
|
|
||||||
|
Initially designed to run directly on a raspberry pi, it has been containerized and now runs anywhere you can install
|
||||||
|
podman or docker!
|
||||||
|
|
||||||
|
## Running the Docker Image
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
|
||||||
|
- Docker installed on your system
|
||||||
|
|
||||||
|
### Quick Start with Docker
|
||||||
|
|
||||||
|
Pull the latest image from GitHub Container Registry:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker pull ghcr.io/lucasoskorep/pi-mta-sign:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
Run the container:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run -d \
|
||||||
|
-p 8000:8000 \
|
||||||
|
--name pi-mta-sign \
|
||||||
|
ghcr.io/lucasoskorep/pi-mta-sign:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
The application will be available at `http://localhost:8000`
|
||||||
|
|
||||||
|
### Environment Variables
|
||||||
|
|
||||||
|
| Variable | Description | Default | Required |
|
||||||
|
|-------------------|---------------------------------|---------|----------|
|
||||||
|
| `FRONTEND_ENABLE` | Enable/disable the web frontend | `true` | No |
|
||||||
|
|
||||||
|
### Running with Docker Compose
|
||||||
|
|
||||||
|
For a more convenient setup, use the provided docker-compose configuration:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Copy the example docker-compose.yaml from the docker folder
|
||||||
|
cp docker/docker-compose.example.yaml docker-compose.yaml
|
||||||
|
|
||||||
|
# Run with docker-compose
|
||||||
|
docker-compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
See `docker/docker-compose.example.yaml` for a complete example configuration.
|
||||||
|
|
||||||
|
### Local Development
|
||||||
|
|
||||||
|
To develop on this app locally you can clone the repo and then in the repo root run the following
|
||||||
|
|
||||||
|
Tools needed:
|
||||||
|
|
||||||
|
- [just](https://github.com/casey/just)
|
||||||
|
- [uv](https://github.com/astral-sh/uv)
|
||||||
|
- [fnm](https://github.com/Schniz/fnm)
|
||||||
|
|
||||||
|
Once you have all the required tooling all you need to do is
|
||||||
|
|
||||||
|
```bash
|
||||||
|
just init # downloads python
|
||||||
|
|
||||||
|
just dev # this will spin up the nextjs frontend and fastapi backend in hot reload mode
|
||||||
|
```
|
||||||
|
|||||||
11
docker/docker-compose.example.yaml
Normal file
11
docker/docker-compose.example.yaml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
pi-mta-sign:
|
||||||
|
image: ghcr.io/lucasoskorep/pi-mta-sign:latest
|
||||||
|
container_name: pi-mta-sign
|
||||||
|
ports:
|
||||||
|
- "8000:8000"
|
||||||
|
environment:
|
||||||
|
# OPTIONAL: Enable or disable the web frontend (default: true)
|
||||||
|
FRONTEND_ENABLE: "true"
|
||||||
5
justfile
5
justfile
@@ -5,9 +5,7 @@ default:
|
|||||||
# Setup Python project
|
# Setup Python project
|
||||||
init:
|
init:
|
||||||
uv sync
|
uv sync
|
||||||
|
fnm use
|
||||||
# Setup frontend project
|
|
||||||
init-ui:
|
|
||||||
cd mta-sign-ui && pnpm install
|
cd mta-sign-ui && pnpm install
|
||||||
|
|
||||||
# Build frontend and run FastAPI serving static files
|
# Build frontend and run FastAPI serving static files
|
||||||
@@ -21,7 +19,6 @@ dev:
|
|||||||
echo "Starting FastAPI backend on :8000..."
|
echo "Starting FastAPI backend on :8000..."
|
||||||
uv run python main.py &
|
uv run python main.py &
|
||||||
BACKEND_PID=$!
|
BACKEND_PID=$!
|
||||||
sleep 2
|
|
||||||
echo "Starting Next.js dev server on :3000..."
|
echo "Starting Next.js dev server on :3000..."
|
||||||
cd mta-sign-ui && pnpm dev &
|
cd mta-sign-ui && pnpm dev &
|
||||||
FRONTEND_PID=$!
|
FRONTEND_PID=$!
|
||||||
|
|||||||
Reference in New Issue
Block a user