Skip to content

Deployment

Forewing edited this page Aug 23, 2020 · 6 revisions

Note: this section only include deployment guide, for detailed configuration, please go to Configuration Guide

From Docker

Config

Using environment variable

  • We provide a example docker-compose.yml file, which use environment config methods.

  • Edit .env file.

Using command flags

  • Remove env_file config (or keep it to override some fields).

  • Set your flags in command.

# env_file:
#   .env
command: -bind=0.0.0.0:8008 -debug

Using config file

  • Remove env_file config (or keep it to override some fields).

  • Add volumes for your config file.

  • Add command to set config file path.

# env_file:
#   .env
command: -conf=/app/conf.yml
volumes:
  - REAL_PATH/conf.yml:/app/conf.yml

Database

sqlite3

  • Set volumes for sqlite3 database file for data persistence.
volumes:
  - REAL_PATH/sqlite3.db:/app/sqlite3.db

You may need to create REAL_PATH/sqlite3.db as an empty file first to prevent docker create it as a directory.

mysql

  • Mysql is linked to server as host db and listening at 3306, you may set DB_ADDR to db:3306

From Source

  • Build as README.md

  • If you need sqlite3 support, you neet to build on the same platform as your production environment and with cgo enabled.

  • If sqlite3 is not needed, you can cross compile to any platform by using GOOS=${TARGET_OS} GOARCH=${TARGET_ARCH} go build

    go to go/build/syslist.go for all avaliable values.

From Binary

  • Get a copy of the server binary matching your OS/Arch from Release Page.

  • Run the binary