Add a Dockerfile

This commit is contained in:
Noah 2025-02-02 23:27:46 -08:00
parent ba5fb2d48d
commit e67d61a1a3
5 changed files with 84 additions and 0 deletions

4
.dockerignore Normal file
View File

@ -0,0 +1,4 @@
logs
node_modules
dist
*.sqlite

6
.gitignore vendored
View File

@ -1,5 +1,11 @@
settings.toml
chatbot/
*.sqlite
# Binaries
BareBot
BareRTC
# Logs
logs
*.log

16
Dockerfile Normal file
View File

@ -0,0 +1,16 @@
FROM golang:1.23-alpine AS base
RUN apk add make bash git nodejs npm
WORKDIR /app
COPY go.mod go.sum package.json package-lock.json ./
RUN go mod download
RUN npm install
COPY . ./
RUN npm run build
RUN make build
CMD ["./BareRTC"]

View File

@ -5,12 +5,22 @@ This document will explain how to download and install BareRTC on your own web s
At this time, BareRTC is not released as a versioned pre-built archive, but as source code. This may change in the future but for now you'll need to git clone or download the source code and compile it, all of which should be easy to do on a Linux or macOS server.
- [Installing BareRTC](#installing-barertc)
- [Docker Compose](#docker-compose)
- [Requirements \& Dependencies](#requirements--dependencies)
- [Installation](#installation)
- [Deploying to Production](#deploying-to-production)
- [Developing This App](#developing-this-app)
- [License](#license)
## Docker Compose
There is an easy docker-compose.yml in the git repo:
```bash
docker-compose up
```
Look inside the file for more information.
## Requirements & Dependencies

48
docker-compose.yml Normal file
View File

@ -0,0 +1,48 @@
version: "3"
# Docker Compose manifest for BareRTC.
#
# Usage is simple:
#
# docker-compose up
#
# If happy, run `docker-compose up -d` to run it in the background.
#
# It will bind certain files in your current working directory:
#
# ./settings.toml for the app settings.
# ./database.sqlite for chat history DMs.
# ./logs for any log output written by the app.
services:
# BareRTC web app.
web:
build: .
container_name: barertc
ports:
- "9000:9000" # host:container
volumes:
- "./settings.toml:/app/settings.toml:z"
- "./database.sqlite:/app/database.sqlite:z"
- "./logs:/app/logs:z"
# TURN server.
coturn:
image: "coturn/coturn:latest"
container_name: coturn_server
ports:
## STUN/TURN
- "3478:3478"
- "3478:3478/udp"
# - "3479:3479"
# - "3479:3479/udp"
# - "80:80"
# - "80:80/udp"
## STUN/TURN SSL
# - "5349:5349"
# - "5349:5349/udp"
# - "5350:5350"
# - "5350:5350/udp"
# - "443:443"
# - "443:443/udp"