mirror of
https://github.com/darkwire/darkwire.io.git
synced 2025-07-18 10:49:02 +00:00
Fix dockerfile
This commit is contained in:
parent
27c0214c5e
commit
d2846e1605
10
Dockerfile
10
Dockerfile
@ -1,11 +1,9 @@
|
|||||||
FROM node:18-alpine3.17
|
FROM node:18-bullseye-slim
|
||||||
|
|
||||||
# Installing yarn
|
|
||||||
RUN apt update -y && \
|
|
||||||
apt install yarn=v1.22.4 -v -y
|
|
||||||
|
|
||||||
USER node:node
|
USER node:node
|
||||||
|
|
||||||
|
WORKDIR /home/node
|
||||||
|
|
||||||
# Server environmental variables will be put into server/.env
|
# Server environmental variables will be put into server/.env
|
||||||
ENV MAILGUN_API_KEY=api-key \
|
ENV MAILGUN_API_KEY=api-key \
|
||||||
MAILGUN_DOMAIN=darkwire.io \
|
MAILGUN_DOMAIN=darkwire.io \
|
||||||
@ -26,7 +24,7 @@ ENV TZ=UTC \
|
|||||||
|
|
||||||
COPY --chown=node:node . .
|
COPY --chown=node:node . .
|
||||||
|
|
||||||
RUN yarn build
|
RUN yarn && yarn build
|
||||||
|
|
||||||
STOPSIGNAL SIGINT
|
STOPSIGNAL SIGINT
|
||||||
EXPOSE 3001
|
EXPOSE 3001
|
||||||
|
5
app.json
5
app.json
@ -50,8 +50,5 @@
|
|||||||
"required": false
|
"required": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"image": "heroku/nodejs",
|
"image": "heroku/nodejs"
|
||||||
"addons": [
|
|
||||||
"heroku-redis"
|
|
||||||
]
|
|
||||||
}
|
}
|
@ -12,6 +12,7 @@ import 'bootstrap/dist/js/bootstrap.bundle.min.js';
|
|||||||
import configureStore from '@/store/';
|
import configureStore from '@/store/';
|
||||||
import Home from '@/components/Home/';
|
import Home from '@/components/Home/';
|
||||||
import { hasTouchSupport } from '@/utils/dom';
|
import { hasTouchSupport } from '@/utils/dom';
|
||||||
|
import { AlertTriangle } from 'react-feather';
|
||||||
|
|
||||||
const store = configureStore();
|
const store = configureStore();
|
||||||
|
|
||||||
@ -45,6 +46,11 @@ const Main = () => {
|
|||||||
|
|
||||||
const root = createRoot(document.getElementById('root') as HTMLElement);
|
const root = createRoot(document.getElementById('root') as HTMLElement);
|
||||||
|
|
||||||
|
if (!window.crypto || !window.crypto.subtle) {
|
||||||
|
window.alert("You must access Darkwire from a secure HTTPS connection.")
|
||||||
|
throw new Error("You must access Darkwire from a secure HTTPS connection.")
|
||||||
|
}
|
||||||
|
|
||||||
root.render(
|
root.render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<Main />
|
<Main />
|
||||||
|
@ -3,7 +3,7 @@ export default class Crypto {
|
|||||||
this._crypto = window.crypto || false;
|
this._crypto = window.crypto || false;
|
||||||
|
|
||||||
if (!this._crypto || (!this._crypto.subtle && !this._crypto.webkitSubtle)) {
|
if (!this._crypto || (!this._crypto.subtle && !this._crypto.webkitSubtle)) {
|
||||||
return false;
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,4 +18,7 @@ export default defineConfig({
|
|||||||
resolve: {
|
resolve: {
|
||||||
alias: [{ find: '@', replacement: resolve(projectRootDir, 'src') }],
|
alias: [{ find: '@', replacement: resolve(projectRootDir, 'src') }],
|
||||||
},
|
},
|
||||||
|
build:{
|
||||||
|
chunkSizeWarningLimit: 1000
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
version: '3.0'
|
version: '3.0'
|
||||||
services:
|
services:
|
||||||
redis:
|
|
||||||
image: redis:6.0.6
|
|
||||||
networks:
|
|
||||||
- db
|
|
||||||
darkwire.io:
|
darkwire.io:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
|
25
readme.md
25
readme.md
@ -8,7 +8,7 @@ Simple encrypted web chat. Powered by [socket.io](http://socket.io), the [web cr
|
|||||||
|
|
||||||
### Darkwire Server
|
### Darkwire Server
|
||||||
|
|
||||||
[Darkwire server](/server) is a Node.js application that requires redis.
|
[Darkwire server](/server) is a Node.js application.
|
||||||
|
|
||||||
### Darkwire Web Client
|
### Darkwire Web Client
|
||||||
|
|
||||||
@ -21,19 +21,20 @@ The Darkwire.io [web client](/client) is written in JavaScript with React JS and
|
|||||||
Copy `.env.dist` files in `server/` and `client/` directories without the `.dist`
|
Copy `.env.dist` files in `server/` and `client/` directories without the `.dist`
|
||||||
extensions and adapt them to your needs.
|
extensions and adapt them to your needs.
|
||||||
|
|
||||||
You need [Redis](https://redis.io/) in order to make the server works.
|
You must have a https connection for Darkwire to work because it's using crypto browser
|
||||||
A simple way to achieve this, if you have docker, is to execute the following
|
API which is accessible only on localhost and behind a https connection.
|
||||||
command:
|
|
||||||
|
|
||||||
|
#### Manual setup
|
||||||
|
|
||||||
|
You can use nvm to install the right version of node using this command:
|
||||||
|
|
||||||
```
|
```
|
||||||
docker run --name darkwire-redis --rm -p 6379:6379 -d redis redis-server --appendonly yes
|
nvm install # If not already installed
|
||||||
|
nvm use
|
||||||
|
npm install yarn -g
|
||||||
```
|
```
|
||||||
|
|
||||||
Alternatively, you can select the _memory_ `STORE_BACKEND` instead of _redis_
|
|
||||||
in your server `.env` file to avoid Redis use.
|
|
||||||
|
|
||||||
#### Setup
|
|
||||||
|
|
||||||
Install dependencies
|
Install dependencies
|
||||||
|
|
||||||
```
|
```
|
||||||
@ -55,7 +56,7 @@ Just run the following:
|
|||||||
$ docker-compose up
|
$ docker-compose up
|
||||||
```
|
```
|
||||||
|
|
||||||
This will automatically create the default `.env` files, and run redis for you.
|
This will automatically create the default `.env` files for you.
|
||||||
|
|
||||||
### Production
|
### Production
|
||||||
|
|
||||||
@ -82,7 +83,7 @@ $ docker build --tag darkwire.io:latest .
|
|||||||
Then run it. Example:
|
Then run it. Example:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ docker run --name darkwire.io --env STORE_HOST=redis://redis.host:6379 darkwire.io
|
$ docker run --init --name darkwire.io --rm -p 3001:3001 darkwire.io
|
||||||
```
|
```
|
||||||
|
|
||||||
You are able to use any of the enviroment variables available in `server/.env.dist` and `client/.env.dist`. The defaults are available in [Dockerfile](Dockerfile)
|
You are able to use any of the enviroment variables available in `server/.env.dist` and `client/.env.dist`. The defaults are available in [Dockerfile](Dockerfile)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user