Skip to content

Commit 48600b2

Browse files
committed
set up deployment
1 parent fdc7101 commit 48600b2

File tree

5 files changed

+77
-0
lines changed

5 files changed

+77
-0
lines changed

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# flyctl launch added from .gitignore
2+
**/node_modules
3+
**/package-lock.json
4+
**/turn-credentials.php
5+
**/.vscode
6+
fly.toml

.github/workflows/fly-deploy.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/
2+
3+
name: Fly Deploy
4+
on:
5+
push:
6+
branches:
7+
- main
8+
jobs:
9+
deploy:
10+
name: Deploy app
11+
runs-on: ubuntu-latest
12+
concurrency: deploy-group # optional: ensure only one action runs at a time
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: superfly/flyctl-actions/setup-flyctl@master
16+
- run: flyctl deploy --remote-only
17+
env:
18+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM nginx
2+
3+
WORKDIR /var/www/html
4+
COPY . /var/www/html/algora-rtc
5+
COPY nginx.conf /etc/nginx/conf.d/default.conf
6+
7+
EXPOSE 80
8+
9+
CMD ["nginx", "-g", "daemon off;"]

fly.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# fly.toml app configuration file generated for vdo-ninja on 2024-10-02T16:27:43+03:00
2+
#
3+
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
4+
#
5+
6+
app = 'vdo-ninja'
7+
primary_region = 'ams'
8+
9+
[build]
10+
11+
[http_service]
12+
internal_port = 80
13+
force_https = true
14+
auto_stop_machines = 'stop'
15+
auto_start_machines = true
16+
min_machines_running = 0
17+
processes = ['app']
18+
19+
[[vm]]
20+
size = 'shared-cpu-1x'

nginx.conf

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
server {
2+
listen 80;
3+
listen [::]:80;
4+
5+
server_name algora.live;
6+
7+
root /var/www/html/algora-rtc;
8+
index index.html;
9+
10+
11+
location ~ ^/([^/]+)/([^/?]+)$ {
12+
root /var/www/html/algora-rtc;
13+
try_files /$1/$2 /$1/$2.html /$1/$2/ /$2 /$2/ /$1/index.html;
14+
add_header Access-Control-Allow-Origin *;
15+
}
16+
17+
location / {
18+
if ($request_uri ~ ^/(.*)\.html$) {
19+
return 302 /$1;
20+
}
21+
try_files $uri $uri.html $uri/ /index.html;
22+
add_header Access-Control-Allow-Origin *;
23+
}
24+
}

0 commit comments

Comments
 (0)