Comments (6)
It should be possible. Are you familiar with docker-compose? Then perhaps you could start from here https://github.com/nmaro/ooth/blob/master/examples/standalone/docker-compose.yml
from ooth.
Thanks @nmaro ! I'm not a intensive user on docker-compose, but I see a good tool Kompose(http://kompose.io/) might help bridge the gap, will give a try soon! Thx!
from ooth.
Here would be another example (with next.js) I just created yesterday: https://github.com/nmaro/staart/tree/master/examples/staart
from ooth.
Thanks @nmaro! I was able to deploy previously mentioned standalone example in my kubernetes cluster, but I haven't figure out the how to get it properly hooked up with my api-gateway: ambassador (https://www.getambassador.io). Feel that I need to update the logic in api part to make it fit ambassador's need. Right?
from ooth.
Yes. Question: are you going to run the api on a different domain? Then you will need JWT. Otherwise I'd recommend working with sessions (this is my preferred solution, in the staart example I use a reverse proxy to keep everything together)... If you work with sessions you can just hook all services to the same session storage (e.g. redis, I did this in the staart example). If you work with JWT you will need to extend your API for auth with JWT, e.g. like here: https://github.com/nmaro/ooth/blob/master/examples/standalone/api/index.js#L47
from ooth.
Here are yaml files I created based on the standalone example for the API and ooth. These will create a kubernetes service and deployment for the API and ooth.
Hopefully these can be helpful
api.yaml
apiVersion: v1
kind: Service
metadata:
name: yourapp-api
labels:
app: yourapp-api
spec:
type: NodePort
ports:
- port: 3002
selector:
app: yourapp-api
---
apiVersion: 'extensions/v1beta1'
kind: 'Deployment'
metadata:
name: 'yourapp-api'
spec:
replicas: 1
selector:
matchLabels:
app: 'yourapp-api'
template:
metadata:
labels:
app: 'yourapp-api'
spec:
containers:
- name: 'yourapp-api'
image: 'yourapp-api:latest'
imagePullPolicy: 'Always'
ports:
- containerPort: 3002
name: yourappapi-port
env:
- name: NODE_ENV
value: 'development'
- name: URL
value: 'https://api.EXAMPLE.com'
- name: PORT
value: '3002'
- name: ORIGIN_URL
value: '*'
- name: MONGO_URL
value: 'mongodb://MONGOUSER_USERNAME:MONGOUSER_PASSWORD@MONGOSERVER:27017/MONGOCOLLECTION'
- name: SHARED_SECRET
value: 'A-SUPER-SECRET-SECRET'
- name: SESSION_SECRET
value: 'ANOTHER-SUPER-SECRET-SECRET'
ooth.yaml
apiVersion: v1
kind: Service
metadata:
name: yourapp-ooth
labels:
app: yourapp-ooth
spec:
type: NodePort
ports:
- port: 3001
selector:
app: yourapp-ooth
---
apiVersion: 'extensions/v1beta1'
kind: 'Deployment'
metadata:
name: 'yourapp-ooth'
spec:
replicas: 1
selector:
matchLabels:
app: 'yourapp-ooth'
template:
metadata:
labels:
app: 'yourapp-ooth'
spec:
containers:
- name: 'yourapp-ooth'
image: 'yourapp-ooth:latest'
imagePullPolicy: 'Always'
ports:
- containerPort: 3001
name: yourapp-ooth
env:
- name: NODE_ENV
value: 'development'
- name: URL
value: 'https://ooth.EXAMPLE.com'
- name: PORT
value: '3001'
- name: ORIGIN_URL
value: '*'
- name: MONGO_URL
value: 'mongodb://MONGOUSER_USERNAME:MONGOUSER_PASSWORD@MONGOSERVER:27017/MONGOCOLLECTION'
- name: MAIL_FROM
value: '[email protected]'
- name: MAIL_SITE_NAME
value: 'Your App'
- name: MAIL_URL
value: 'https://mg.EXAMPLE.com'
- name: MAILGUN_API_KEY
value: 'YOUR_MAILGUN_API_KEY'
- name: MAILGUN_DOMAIN
value: 'YOUR_MAILGUN_DOMAIN'
- name: SHARED_SECRET
value: 'A-SUPER-SECRET-SECRET'
- name: SESSION_SECRET
value: 'ANOTHER-SUPER-SECRET-SECRET'
from ooth.
Related Issues (20)
- This is not defined. It's defined above in another scope. I can do a pull request if you want me to... HOT 1
- Typescript HOT 3
- ooth-local-emailer url parameter HOT 1
- local-plugin: remember me HOT 3
- TypeError: Ooth is not a constructor HOT 4
- Accessing users' roles through withUser HOC HOT 1
- prisma backend? HOT 2
- [Backend] Prisma Integration as alternative to mongodb HOT 10
- Passworless login using Twillio HOT 1
- Enhance ooth Documentation
- React Native error "Canβt Find Variable Self" when import { OothClient } from 'ooth-client' HOT 1
- Capcha strategy
- TypeError: ooth.usesSession is not a function
- User serialization / deserialization
- Profile on registration HOT 1
- Ooth Client headers
- oothJwt and reset password
- Is this project still maintained? HOT 1
- Wildcard Sessions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ooth.