Merge pull request #5 from JBB0807/auth-print-2
Added file for Fly.io and OAuth
This commit is contained in:
commit
f4ee9dad40
6 changed files with 129 additions and 1 deletions
26
.dockerignore
Normal file
26
.dockerignore
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# flyctl launch added from .gitignore
|
||||
# Logs
|
||||
**\logs
|
||||
**\*.log
|
||||
**\npm-debug.log*
|
||||
**\yarn-debug.log*
|
||||
**\yarn-error.log*
|
||||
**\pnpm-debug.log*
|
||||
**\lerna-debug.log*
|
||||
|
||||
**\node_modules
|
||||
**\dist
|
||||
**\dist-ssr
|
||||
**\*.local
|
||||
|
||||
# Editor directories and files
|
||||
**\.vscode\*
|
||||
!**\.vscode\extensions.json
|
||||
**\.idea
|
||||
**\.DS_Store
|
||||
**\*.suo
|
||||
**\*.ntvs*
|
||||
**\*.njsproj
|
||||
**\*.sln
|
||||
**\*.sw?
|
||||
fly.toml
|
||||
18
.github/workflows/fly-deploy.yml
vendored
Normal file
18
.github/workflows/fly-deploy.yml
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/
|
||||
|
||||
name: Fly Deploy
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
jobs:
|
||||
deploy:
|
||||
name: Deploy app
|
||||
runs-on: ubuntu-latest
|
||||
concurrency: deploy-group # optional: ensure only one action runs at a time
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: superfly/flyctl-actions/setup-flyctl@master
|
||||
- run: flyctl deploy --remote-only
|
||||
env:
|
||||
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
|
||||
27
Dockerfile
Normal file
27
Dockerfile
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# Build Stage
|
||||
FROM node:18 AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
# Serve Stage
|
||||
FROM nginx:stable-alpine
|
||||
|
||||
# Copy built React files into nginx public folder
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
|
||||
# Remove default nginx config
|
||||
RUN rm /etc/nginx/conf.d/default.conf
|
||||
|
||||
# Add your own nginx config
|
||||
COPY nginx.conf /etc/nginx/conf.d
|
||||
|
||||
# Expose port 80
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
42
fly.toml
Normal file
42
fly.toml
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
# fly.toml app configuration file generated for bytecamp-web on 2025-04-21T13:40:11-07:00
|
||||
#
|
||||
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
|
||||
#
|
||||
|
||||
app = 'bytecamp-web'
|
||||
primary_region = 'sea'
|
||||
|
||||
[build]
|
||||
|
||||
[env]
|
||||
PORT = '8080'
|
||||
|
||||
[http_service]
|
||||
internal_port = 80
|
||||
force_https = true
|
||||
auto_stop_machines = 'stop'
|
||||
auto_start_machines = true
|
||||
min_machines_running = 0
|
||||
processes = ['app']
|
||||
|
||||
[[services]]
|
||||
protocol = 'tcp'
|
||||
internal_port = 8080
|
||||
|
||||
[[services.ports]]
|
||||
port = 80
|
||||
handlers = ['http']
|
||||
|
||||
[[services.ports]]
|
||||
port = 443
|
||||
handlers = ['tls', 'http']
|
||||
|
||||
[[services.tcp_checks]]
|
||||
interval = '10s'
|
||||
timeout = '2s'
|
||||
grace_period = '5s'
|
||||
|
||||
[[vm]]
|
||||
memory = '1gb'
|
||||
cpu_kind = 'shared'
|
||||
cpus = 1
|
||||
11
nginx.conf
Normal file
11
nginx.conf
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
location / {
|
||||
try_files $uri /index.html;
|
||||
}
|
||||
}
|
||||
|
|
@ -29,12 +29,16 @@ function SignUpForm() {
|
|||
}
|
||||
};
|
||||
|
||||
const googleAuth = () => {
|
||||
window.open("https://byte-camp-auth-service.fly.dev/auth/google", "_self");
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="form-container sign-up-container">
|
||||
<form onSubmit={handleOnSubmit}>
|
||||
<h1>Instructor</h1>
|
||||
<div className="social-container">
|
||||
<a href="#" className="social">
|
||||
<a href="#" className="social" onClick={googleAuth}>
|
||||
<i className="fab fa-google-plus-g" />
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue