Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

# syntax=docker/dockerfile:1

FROM node:18-alpine

# Set working directory
WORKDIR /app

# Copy package files and install dependencies
COPY package*.json ./
RUN npm install --production

# Copy the rest of the application
COPY . .

# Set environment variable for SPX_ROOT_FOLDER
ENV SPX_ROOT_FOLDER=/app

# Expose default port
EXPOSE 5656

# Start the server
CMD ["node", "server.js", "config.json"]
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,22 @@ pm2 kill


---

### Docker Support <a id="dockersupport"></a>

To run the project using Docker, follow these steps:

1. **Install Docker**: Ensure you have Docker installed on your system. You can download it from [Docker's official website](https://www.docker.com/).

2. **Build and Run the Docker Container**:
Use the following command to build the Docker image and start the container. This command will build the image and run the container in detached mode, mapping port 5656 from the container to your host machine.

```sh
docker-compose up --build
```
3. **Access the Application**:
Once the container is running, you can access the application via your web browser at `http://localhost:5656`.

# First launch <a id="firstlaunch"></a>
* When the app is started the very first time a default browser is launched with SPX user interface open
* In the subsequent server starts use a web browser (such as Chrome) and load SPX gui from URL shown in the console at the start-up.
Expand Down
18 changes: 18 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

version: '3.8'

services:
spx-gc:
build: .
container_name: spx-gc
ports:
- "5656:5656"
volumes:
- ./DATAROOT:/app/DATAROOT
- ./LOG:/app/LOG
- ./config.json:/app/config.json
- ./ASSETS:/app/ASSETS
environment:
- NODE_ENV=production
- SPX_ROOT_FOLDER=/app
restart: unless-stopped
20 changes: 20 additions & 0 deletions dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

node_modules
npm-debug.log
Dockerfile
docker-compose.yml
.dockerignore
.git
.gitignore
*.log
*.md
*.txt
*.env
*.sh
*.bak
*.swp
*.swo
*.DS_Store
.vscode
.idea
coverage
4 changes: 2 additions & 2 deletions utils/spx_getconf.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ module.exports = {
// cfg.general.launchchrome = false // deprecated
cfg.general.launchBrowser = false
cfg.general.apikey = ""
cfg.general.logfolder = path.join(CURRENT_FOLDER, 'LOG').replace(/\\/g, "/") + "/"
cfg.general.dataroot = path.join(CURRENT_FOLDER, 'DATAROOT').replace(/\\/g, "/") + "/"
cfg.general.logfolder = "./LOG"
cfg.general.dataroot = "./DATAROOT"
cfg.general.templatesource = "spx-ip-address"
cfg.general.port = 5656
cfg.general.disableConfigUI = false
Expand Down