adding docker-compose
parent
5af8687ebb
commit
8779fee2af
@ -0,0 +1,7 @@
|
|||||||
|
.idea/
|
||||||
|
./redis_conf/
|
||||||
|
./redis_data/
|
||||||
|
./node_logs/
|
||||||
|
./node_app./
|
||||||
|
node_modules/
|
||||||
|
./node_app/package-lock.json
|
@ -1,13 +1,13 @@
|
|||||||
# short_url
|
# short_url
|
||||||
This is a simple application to short you urls with your own web server.
|
This is a simple application to short you urls with your own web server.
|
||||||
It is based on Nodejs and Redis.
|
It is based on Nodejs and Redis.
|
||||||
You will have to change the IPs in the `index.js` and `./public/index.html` files to your public IP or domain.
|
You can change the public ports `8080` (web UI) and `8081` (websocket) in the `docker-compose.yml` file
|
||||||
To start the server simply execute `index.js`:
|
To start the server simply use `docker-compose`:
|
||||||
```
|
```
|
||||||
screen -A -m -d -S short_url nodejs index.js
|
docker-compose -p surl up -d
|
||||||
```
|
```
|
||||||
It's recommended to use a reverse proxy like nginx to manage SSL certificates etc.
|
It's recommended to use a reverse proxy like nginx to manage SSL certificates.
|
||||||
|
|
||||||
A test instance is running under [s.adb.sh](https://s.adb.sh).
|
A test instance is running at [s.adb.sh](https://s.adb.sh).
|
||||||
|
|
||||||
//good luck
|
//good luck
|
||||||
|
@ -0,0 +1,31 @@
|
|||||||
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
node:
|
||||||
|
image: node
|
||||||
|
container_name: surl_node
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "8080:8080"
|
||||||
|
- "8081:8081"
|
||||||
|
volumes:
|
||||||
|
- ./node_app/:/home/node/app/
|
||||||
|
# - ./node_modules/:/home/node/app/node_modules/
|
||||||
|
- ./node_logs/:/var/log/
|
||||||
|
working_dir: /home/node/app/
|
||||||
|
environment:
|
||||||
|
- NODE_ENV=production
|
||||||
|
command: sh -c 'npm i && nodejs index.js'
|
||||||
|
links:
|
||||||
|
- redis
|
||||||
|
redis:
|
||||||
|
image: redis
|
||||||
|
container_name: surl_redis
|
||||||
|
expose:
|
||||||
|
- 6379
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- ./redis_data/:/var/lib/redis/
|
||||||
|
- ./redis_conf/:/usr/local/etc/redis/
|
||||||
|
environment:
|
||||||
|
- REDIS_REPLICATION_MODE=master
|
@ -0,0 +1,57 @@
|
|||||||
|
{
|
||||||
|
"name": "surl",
|
||||||
|
"version": "1.1.0",
|
||||||
|
"lockfileVersion": 1,
|
||||||
|
"requires": true,
|
||||||
|
"dependencies": {
|
||||||
|
"denque": {
|
||||||
|
"version": "1.4.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/denque/-/denque-1.4.1.tgz",
|
||||||
|
"integrity": "sha512-OfzPuSZKGcgr96rf1oODnfjqBFmr1DVoc/TrItj3Ohe0Ah1C5WX5Baquw/9U9KovnQ88EqmJbD66rKYUQYN1tQ=="
|
||||||
|
},
|
||||||
|
"mime": {
|
||||||
|
"version": "2.4.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/mime/-/mime-2.4.6.tgz",
|
||||||
|
"integrity": "sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA=="
|
||||||
|
},
|
||||||
|
"redis": {
|
||||||
|
"version": "3.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/redis/-/redis-3.0.2.tgz",
|
||||||
|
"integrity": "sha512-PNhLCrjU6vKVuMOyFu7oSP296mwBkcE6lrAjruBYG5LgdSqtRBoVQIylrMyVZD/lkF24RSNNatzvYag6HRBHjQ==",
|
||||||
|
"requires": {
|
||||||
|
"denque": "^1.4.1",
|
||||||
|
"redis-commands": "^1.5.0",
|
||||||
|
"redis-errors": "^1.2.0",
|
||||||
|
"redis-parser": "^3.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"redis-commands": {
|
||||||
|
"version": "1.6.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/redis-commands/-/redis-commands-1.6.0.tgz",
|
||||||
|
"integrity": "sha512-2jnZ0IkjZxvguITjFTrGiLyzQZcTvaw8DAaCXxZq/dsHXz7KfMQ3OUJy7Tz9vnRtZRVz6VRCPDvruvU8Ts44wQ=="
|
||||||
|
},
|
||||||
|
"redis-errors": {
|
||||||
|
"version": "1.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz",
|
||||||
|
"integrity": "sha1-62LSrbFeTq9GEMBK/hUpOEJQq60="
|
||||||
|
},
|
||||||
|
"redis-parser": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-3.0.0.tgz",
|
||||||
|
"integrity": "sha1-tm2CjNyv5rS4pCin3vTGvKwxyLQ=",
|
||||||
|
"requires": {
|
||||||
|
"redis-errors": "^1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ws": {
|
||||||
|
"version": "7.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ws/-/ws-7.3.1.tgz",
|
||||||
|
"integrity": "sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA=="
|
||||||
|
},
|
||||||
|
"xmlhttprequest": {
|
||||||
|
"version": "1.8.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz",
|
||||||
|
"integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "short_url",
|
"name": "surl",
|
||||||
"version": "1.0.0",
|
"version": "1.1.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"mime": "^2.4.6",
|
"mime": "^2.4.6",
|
||||||
"redis": "^3.0.2",
|
"redis": "^3.0.2",
|
Before Width: | Height: | Size: 268 B After Width: | Height: | Size: 265 B |
Loading…
Reference in New Issue