Просмотр исходного кода

Merge pull request #79 from Bildcraft1/main

Docker support for Server
Mike 1 год назад
Родитель
Сommit
017a1f4eca
3 измененных файлов с 77 добавлено и 0 удалено
  1. 21 0
      Dockerfile
  2. 19 0
      docker-compose.example.yaml
  3. 37 0
      docs/DOCKER.md

+ 21 - 0
Dockerfile

@@ -0,0 +1,21 @@
+# Specifies a parent image
+FROM golang:alpine
+ 
+# Creates an app directory to hold your app’s source code
+WORKDIR /app
+ 
+# Copies everything from your root directory into /app
+COPY . .
+COPY config/settings.env config/settings.env
+ 
+# Installs Go dependencies
+RUN go mod download
+ 
+# Builds your app with optional configuration
+RUN go build -o retro_aim_server ./cmd/server
+ 
+# Tells Docker which network port your container listens on
+EXPOSE 8080 5194 5190 5195 5191 5193 5912 5196 5197
+ 
+# Specifies the executable command that runs when the container starts
+CMD ["/app/retro_aim_server", "-config", "config/settings.env"]

+ 19 - 0
docker-compose.example.yaml

@@ -0,0 +1,19 @@
+version: '3.8'
+
+services:
+  retro-aim-server:
+    build: .
+    ports:
+      - "8080:8080"
+      - "5194:5194"
+      - "5190:5190"
+      - "5195:5195"
+      - "5191:5191"
+      - "5193:5193"
+      - "5912:5912"
+      - "5196:5196"
+      - "5197:5197"
+    volumes:
+      - ./config/settings.env:/app/config/settings.env
+    environment:
+      - OSCAR_HOST=0.0.0.0

+ 37 - 0
docs/DOCKER.md

@@ -0,0 +1,37 @@
+# Retro AIM Server Docker Compose Setup
+
+## Prerequisites
+
+- Docker
+- Docker Compose
+- Project source code
+
+## Configuration
+
+1. Ensure your `config/settings.env` file is properly configured.
+2. Modify environment variables in `docker-compose.yml` as needed.
+
+## Running the Server
+
+### Start the Server
+```bash
+docker-compose up --build
+```
+
+### Stop the Server
+```bash
+docker-compose down
+```
+
+## Authentication Notes
+
+- `DISABLE_AUTH=true` (default) allows any username/password at login
+- This is a development convenience for quickly creating accounts
+- To enforce authentication, set `DISABLE_AUTH=false` in `settings.env`
+- When disabled, use the Management API to create and manage user accounts
+
+## Customization
+
+- Adjust port mappings in `docker-compose.yml`
+- Add volume mounts for persistent configurations
+- Modify environment variables as required