Browse Source

Add Docker Compose support

Signed-off-by: Gary Kim <gary@garykim.dev>
merge-requests/1/head
Gary Kim 1 year ago
parent
commit
b881512e6c
No known key found for this signature in database GPG Key ID: 9349B59FB54594AC
  1. 21
      docker-compose.yml
  2. 13
      docker/backend/Dockerfile
  3. 2
      package.json
  4. 2
      webpack.config.js

21
docker-compose.yml

@ -0,0 +1,21 @@
version: '3'
services:
nc-talk-backend:
build:
context: .
dockerfile: docker/backend/Dockerfile
restart: unless-stopped
network_mode: host
environment:
USE_JANUS: "true"
JANUS_URL: "ws://localhost:8188"
JANUS_API_SECRET: ""
SHARED_SECRET: MySecretValue
BACKEND_PORT: 3000
depends_on:
- janus
janus:
build: docker/janus
restart: unless-stopped
network_mode: host

13
docker/backend/Dockerfile

@ -8,12 +8,21 @@ WORKDIR /usr/src/app
COPY package.json .
COPY . .
RUN npm install
ENV NODE_ENV=production
RUN npm run build
# EXPOSE PORTS
# Set default environment variables
ENV USE_JANUS=TRUE
ENV JANUS_URL=ws://localhost:8188
ENV JANUS_API_SECRET=MyJanusApiSecret
ENV SHARED_SECRET=MySecretValue
ENV BACKEND_PORT=3000
# EXPOSE PORTS
EXPOSE 3000
CMD [ "node /usr/src/app/dist/backend.js" ]
CMD [ "node", "/usr/src/app/dist/backend.js" ]

2
package.json

@ -12,7 +12,7 @@
},
"repository": {},
"author": "Paul Tirk",
"license": "GPL",
"license": "AGPL-3.0",
"dependencies": {
"axios": "^0.19.2",
"body-parser": "^1.19.0",

2
webpack.config.js

@ -4,7 +4,7 @@ const {CleanWebpackPlugin} = require('clean-webpack-plugin');
module.exports = {
entry: './src/backend.ts',
mode: 'development',
mode: process.env.NODE_DEV === 'production' ? 'production' : 'development',
devtool: 'inline-source-map',
target: 'node',
output: {

Loading…
Cancel
Save