kopia lustrzana https://github.com/FacilMap/facilmap
Document how to use postgres
rodzic
d46c49d88e
commit
f456da2e7a
|
@ -6,11 +6,11 @@ This manual assumes that you have docker set up on your system.
|
|||
|
||||
The FacilMap server is available as [`facilmap/facilmap`](https://hub.docker.com/r/facilmap/facilmap/) on Docker Hub. The [configuration](./config.md) can be defined using environment variables. The container will expose a HTTP server on port 8080, which you should put behind a reverse proxy such as [nginx-proxy](https://hub.docker.com/r/jwilder/nginx-proxy) or [traefik](https://traefik.io/traefik/) for HTTPS support.
|
||||
|
||||
FacilMap needs a database supported by [Sequelize](https://sequelize.org/master/) to run, it is recommended to use MySQL/MariaDB. When creating a database for FacilMap, make sure to use the `utf8mb4` charset/collation to make sure that characters from all languages can be used on a map. By default, MySQL/MariaDB uses the `latin1` charset, which mostly supports only basic latin characters. When you start the FacilMap server for the first time, the necessary tables are created using the charset of the database.
|
||||
FacilMap needs a database supported by [Sequelize](https://sequelize.org/master/) to run, it is recommended to use MySQL/MariaDB. When creating a MySQL/MariaDB database for FacilMap, make sure to use the `utf8mb4` charset/collation to make sure that characters from all languages can be used on a map. By default, MySQL/MariaDB uses the `latin1` charset, which mostly supports only basic latin characters. When you start the FacilMap server for the first time, the necessary tables are created using the charset of the database. When using PostgreSQL, the PostGIS extensions must be enabled.
|
||||
|
||||
## docker-compose
|
||||
|
||||
To run FacilMap using [docker-compose](https://docs.docker.com/compose/), here is an example `docker-compose.yml`:
|
||||
To run FacilMap with MySQL using [docker-compose](https://docs.docker.com/compose/), here is an example `docker-compose.yml`:
|
||||
|
||||
```yaml
|
||||
version: "2"
|
||||
|
@ -45,6 +45,39 @@ services:
|
|||
restart: unless-stopped
|
||||
```
|
||||
|
||||
Here is an example with Postgres:
|
||||
|
||||
```yaml
|
||||
version: "2"
|
||||
services:
|
||||
facilmap:
|
||||
image: facilmap/facilmap
|
||||
ports:
|
||||
- 8080
|
||||
links:
|
||||
- db
|
||||
environment:
|
||||
USER_AGENT: My FacilMap (https://facilmap.example.org/, facilmap@example.org)
|
||||
DB_TYPE: postgres
|
||||
DB_HOST: db
|
||||
DB_NAME: facilmap
|
||||
DB_USER: facilmap
|
||||
DB_PASSWORD: password
|
||||
ORS_TOKEN: # Get an API key on https://go.openrouteservice.org/ (needed for routing)
|
||||
MAPBOX_TOKEN: # Get an API key on https://www.mapbox.com/signup/ (needed for routing)
|
||||
MAPZEN_TOKEN: # Get an API key on https://mapzen.com/developers/sign_up (needed for elevation info)
|
||||
MAXMIND_USER_ID: # Sign up here https://www.maxmind.com/en/geolite2/signup (needed for geoip lookup to show initial map state)
|
||||
MAXMIND_LICENSE_KEY:
|
||||
restart: unless-stopped
|
||||
db:
|
||||
image: postgis/postgis
|
||||
environment:
|
||||
POSTGRES_USER: facilmap
|
||||
POSTGRES_PASSWORD: password
|
||||
POSTGRES_DB: facilmap
|
||||
restart: unless-stopped
|
||||
```
|
||||
|
||||
To start FacilMap, run `docker-compose up -d` in the directory of the `docker-compose.yml` file. To upgrade FacilMap, run `docker-compose pull` and then restart it by running `docker-compose up -d`.
|
||||
|
||||
## docker create
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
|
||||
The FacilMap server is written in [node.js](https://nodejs.org/en/). To run the FacilMap server, the following dependencies are needed:
|
||||
* You need to have a recent version of node.js and npm installed.
|
||||
* You need to create a database on one of the systems supported by [Sequelize](https://sequelize.org/master/), it is recommended to use MySQL/MariaDB. When creating a database for FacilMap, make sure to use the `utf8mb4` charset/collation to make sure that characters from all languages can be used on a map. By default, MySQL/MariaDB uses the `latin1` charset, which mostly supports only basic latin characters. When you start the FacilMap server for the first time, the necessary tables are created using the charset of the database.
|
||||
* You need to create a database on one of the systems supported by [Sequelize](https://sequelize.org/master/), it is recommended to use MySQL/MariaDB.
|
||||
* When creating a MySQL/MariaDB database for FacilMap, make sure to use the `utf8mb4` charset/collation to make sure that characters from all languages can be used on a map. By default, MySQL/MariaDB uses the `latin1` charset, which mostly supports only basic latin characters. When you start the FacilMap server for the first time, the necessary tables are created using the charset of the database.
|
||||
* When using PostgreSQL, the PostGIS extensions must be enabled.
|
||||
* It is recommended to run FacilMap as an unprivileged user.
|
||||
|
||||
## Run the latest release
|
||||
|
|
Ładowanie…
Reference in New Issue