Skip to content

Commit c9fcb0a

Browse files
authored
Merge pull request #8 from croyla/main
Update main repo
2 parents 724d11a + b59e6af commit c9fcb0a

File tree

96 files changed

+359123
-23228
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+359123
-23228
lines changed

.github/workflows/docker-image.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Docker Image CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
11+
build:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v5.0.0
18+
- name: Login to GitHub Container Registry
19+
uses: docker/login-action@v3.5.0
20+
with:
21+
registry: ghcr.io
22+
username: ${{ github.actor }}
23+
password: ${{ secrets.GITHUB_TOKEN }}
24+
- name: Build Docker Image
25+
uses: docker/build-push-action@v6.18.0
26+
with:
27+
context: .
28+
push: true
29+
tags: ghcr.io/${{ github.repository }}:latest

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@ log/
55
nohup.out
66
/out/
77
__pycache__/
8-
db/live_data.db
9-
8+
db/
9+
generated_in/
10+
*.log
11+
.DS_Store
12+
/models/

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ RUN apt-get update && apt-get install -y curl build-essential && \
1717
# Set working directory
1818
WORKDIR /app
1919

20+
# Container timezone defaults to IST
21+
RUN echo "Asia/Kolkata" > /etc/timezone
22+
2023
# Copy only Poetry files first to install dependencies
2124
COPY pyproject.toml poetry.lock* ./
2225

@@ -31,6 +34,8 @@ COPY . .
3134
EXPOSE 59966
3235

3336
VOLUME /app/db
37+
VOLUME /app/in
38+
VOLUME /app/out
3439

3540
# Set default command
3641
CMD ["poetry", "run", "python3", "-m", "src.main"]

README.MD

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ This is expected to be functioning on an AWS EC2 Instance, however it can techni
66
via the poetry package manager `poetry install` command. Once installed you can simply run it via
77
`poetry run python -m src.main` from the `src` folder. To expose it you can use an nginx reverse proxy, or cloudflared type tunnelling service. It will run on port `59966` to avoid conflicts with other services.
88

9+
The `generate_in_files.py` generates files to replace in the `in/` directory. Options listed below:
10+
11+
| Option | Note |
12+
|--------|------------------------------------------------------------|
13+
| -r | Create routeline.json with API data |
14+
| -t | Create timings.tsv with API data |
15+
| -tdb | Create times.json with live_data.db predictions |
16+
| -s | Create client_stops.json with API data |
17+
| -c | Copy all generated files, overwriting existing `in/` files |
18+
19+
920
*The old.py script runs on port 59955*
1021
- ### Data:
1122
Data is returned in the GTFS/GTFS-RT standard format.

0 commit comments

Comments
 (0)