Skip to content

Commit f575128

Browse files
committed
small cleanup
1 parent d542141 commit f575128

File tree

9 files changed

+49
-69
lines changed

9 files changed

+49
-69
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,5 +224,7 @@ dist
224224
.ionide
225225

226226
# End of https://www.toptal.com/developers/gitignore/api/macos,linux,visualstudiocode,git,node
227+
228+
# Ignore certificate files
227229
cert.pem
228230
key.pem

Dockerfile.relay

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,31 @@
1-
FROM rustlang/rust:nightly AS relay-builder
1+
FROM rust:alpine AS relay-builder
22

3-
WORKDIR /usr/src/app
3+
# Install system dependencies
4+
RUN apk --no-cache add git musl-dev
45

5-
RUN apt-get update && apt-get install -y git \
6-
&& git clone https://github.com/streaming-university/moqtail.git
6+
# Clone the relay (draft 11)
7+
WORKDIR /moqtail
8+
RUN git init . && \
9+
git remote add origin https://github.com/streaming-university/moqtail.git && \
10+
git fetch --depth 1 origin fd691b4387c91b72acc4d264d4da092af49b7b0d && \
11+
git checkout fd691b4387c91b72acc4d264d4da092af49b7b0d
712

8-
WORKDIR /usr/src/app/moqtail
13+
# Build the relay
14+
RUN cargo install --path apps/relay
915

16+
FROM alpine:latest
17+
18+
# Install required dependencies
19+
RUN apk --no-cache add ca-certificates
20+
21+
# Create directory for relay certificates
22+
RUN mkdir -p /etc/relay/cert
23+
24+
# Copy the relay binary from the builder stage
25+
COPY --from=relay-builder /usr/local/cargo/bin/relay /usr/local/bin/relay
26+
27+
# Expose the relay port
1028
EXPOSE 4433
1129

12-
CMD ["cargo", "run", "--bin", "relay", "--", "--port", "4433", "--cert-file", "cert/cert.pem", "--key-file", "cert/key.pem"]
30+
# Start the relay
31+
CMD ["relay", "--cert-file", "/etc/relay/cert/cert.pem", "--key-file", "/etc/relay/cert/key.pem"]

README.md

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -16,40 +16,7 @@ mkcert -key-file cert/key.pem -cert-file cert/cert.pem localhost 127.0.0.1 ::1
1616
docker compose up --build
1717
```
1818

19-
**🚀 The app will be available at [http://localhost:5173](http://localhost:5173) by default.**
19+
**🚀 The app will be available at [http://localhost:4173](http://localhost:4173) by default.**
2020

2121
> [!NOTE]
22-
> If not working, please check the notes in cert/README.md
23-
24-
## Sample Project Structure
25-
26-
```
27-
apps/client/
28-
29-
├── public
30-
│   ├── ...
31-
├── src
32-
│   ├── App.tsx
33-
│   ├── composables
34-
│   │   └── useVideoPipeline.ts
35-
│   ├── contexts
36-
│   │   └── SessionContext.tsx
37-
│   ├── index.css
38-
│   ├── main.tsx
39-
│   ├── pages
40-
│   │   ├── JoinPage.tsx
41-
│   │   └── SessionPage.tsx
42-
│   ├── sockets
43-
│   │   └── SocketContext.tsx
44-
│   ├── startup.ts
45-
│   ├── types
46-
│   │   ├── AppSettings.ts
47-
│   │   └── types.ts
48-
│   ├── videoUtils.ts
49-
│   ├── vite-env.d.ts
50-
│   └── workers
51-
│   ├── decoderWorker.ts
52-
│   └── pcmPlayerProcessor.js
53-
├── ...
54-
55-
```
22+
> If you experience issues with TLS certificates, please check the [README](cert/README.md) in the `cert` directory for troubleshooting steps.

apps/client/Dockerfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
FROM node:22-alpine
1+
FROM node:alpine
22

33
WORKDIR /usr/src/app
44

5+
# Copy package files and install dependencies
56
COPY package*.json ./
7+
RUN npm install --prefer-offline --no-audit --progress=false
68

7-
RUN npm install
8-
9+
# Copy source code and build
910
COPY . .
11+
RUN npm run build
1012

1113
EXPOSE 5173
1214

13-
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]
15+
# Start the application in preview mode, accessible from any host
16+
CMD ["npm", "run", "preview", "--", "--host", "0.0.0.0"]

apps/room-server/Dockerfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
FROM node:22-alpine
1+
FROM node:alpine
22

3+
# Set working directory
34
WORKDIR /usr/src/app
45

6+
# Copy package files and install dependencies
57
COPY package*.json ./
8+
RUN npm install --prefer-offline --no-audit --progress=false
69

7-
RUN npm install
8-
10+
# Copy application source
911
COPY . .
1012

13+
# Expose application port
1114
EXPOSE 3001
1215

16+
# Start the application
1317
CMD ["npm", "run", "start"]

apps/room-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"devDependencies": {
2121
"@tsconfig/node-lts": "^18.12.1",
2222
"nodemon": "^3.1.0",
23-
"typescript": "^5.9.3"
23+
"typescript": "^5.5.3"
2424
},
2525
"keywords": [],
2626
"author": "",

docker-compose.yml

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,19 @@ services:
33
build:
44
context: .
55
dockerfile: Dockerfile.relay
6-
container_name: relay
76
ports:
87
- '4433:4433/udp'
98
volumes:
10-
- ./cert:/usr/src/app/moqtail/cert
11-
networks:
12-
- timetravel-net
9+
- ./cert:/etc/relay/cert:ro
1310

1411
room-server:
1512
build:
1613
context: ./apps/room-server
17-
dockerfile: Dockerfile
18-
container_name: room-server
1914
ports:
2015
- '3001:3001'
21-
networks:
22-
- timetravel-net
2316

2417
client:
2518
build:
2619
context: ./apps/client
27-
dockerfile: Dockerfile
28-
container_name: client
2920
ports:
30-
- '5173:5173'
31-
networks:
32-
- timetravel-net
33-
34-
networks:
35-
timetravel-net:
36-
driver: bridge
21+
- '4173:4173'

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"devDependencies": {
1717
"husky": "^9.1.7",
18-
"lint-staged": "^16.2.3",
18+
"lint-staged": "^16.1.2",
1919
"prettier": "^3.5.3"
2020
},
2121
"packageManager": "npm@11.5.2+sha512.aac1241cfc3f41dc38780d64295c6c6b917a41e24288b33519a7b11adfc5a54a5f881c642d7557215b6c70e01e55655ed7ba666300fd0238bc75fb17478afaf3"

0 commit comments

Comments
 (0)