Sign inSign up

calipseo/formio

By calipseo

•Updated about 6 years ago

Image
3

1M+

calipseo/formio repository overview

⁠Quick Reference

⁠Docker for Formio API Server

This is a Dockerfile for the Formio API Server⁠. Dockerfiles building on a specific Formio API Server version are now available as tags. You can request a specific version using the apporpiate tag, e.g. calipseo/formio:1.87.0. Aside from the Formio API Server, it also includes the Formio Form Manager⁠ application.

⁠Usage

To run a temporary container with Formio API Server:

docker run -p 3001:3001 \
  -e "MONGO=mongodb://172.16.0.1:27017/formio" \
  -e "[email protected]" \
  -e "ROOT_PASSWORD=CHANGEME" \
  calipseo/formio

To get a specific version of the Formio API Server:

docker run -p 3001:3001 \
  -e "MONGO=mongodb://172.16.0.1:27017/formio" \
  -e "[email protected]" \
  -e "ROOT_PASSWORD=CHANGEME" \
  calipseo/formio:1.87.0

⁠Configuration Variables

Below are the main variables that you can set within your docker container. See the Email Transport⁠ section for additional possible variables.

KeyDescriptionDefault
API_URLThe publicly accesible URL for the Formio API Server used to configure the Formio form manager application.http://localhost:3001
APP_URLThe publicly accessible URL for the Formio Form Manager application.http://localhost:3001
MONGOThe MongoDB connection string to connect to your remote database.mongodb://172.16.0.1:27017
MONGO_HIGH_AVAILABILITYIf your database is high availability (like from Mongo Cloud or Compose), then this needs to be set.
MONGO_SAThe mongodb certificate authority used to validate SSL connections.
MONGO_SECRETThe mongo secret used by the Formio API Server to encrypt / decrypt data. You cannot change this after initialization.--- change me now ---
MONGO_CONFIGProvides a way to pass custom MongoDB configurations into the MongoDB connection string. This should be a JSON string, and all the configurations are documented at https://mongoosejs.com/docs/connections.html#options⁠.
ADMIN_KEYAn optional key that gives full access to the server including listing all projects. Send in a header with x-admin-key.
ROOT_EMAILThe default email of the super admin account. Only on initial startup of the Formio API Server.[email protected]
ROOT_PASSWORDThe default password of the super admin account. Only on initial startup of the Formio API Server.CHANGEME
JWT_SECRETThe secret password for JWT token encryption.--- change me now ---
JWT_EXPIREThe expiration for the JWT Tokens240
EMAIL_OVERRIDEProvides a way to point all Email traffic to a server.
DEBUGAdding debugging messages to the server. Use ‘formio.’ for all Form.io messages and ‘.*’ for all debug messages.

⁠MongoDB

The Formio API Server relies on MongoDB. You can specify the mongo connection string by defining the MONGO environment variables. The default connection string is mongodb://172.16.0.1:27017/formio (172.16.0.1 is almost always the default host IP).

You can directly specify the connection parameters passing the complete mongodb connection string using the MONGO variable:

docker run -p 3001:3001 \
  -e "MONGO=mongodb://172.16.0.1:27017/formio" \
  -e "MONGO_SECRET=CHANGEME"
  calipseo/formio

⁠Project Template

Once the Formio API Server starts, it will import the default project template provided by the official Formio Form Manager application available here⁠. To use your custom project template, you must expose the template file to the container on /srv/formio/client/dist.

docker run -p 3001:3001 \
  -e "MONGO=mongodb://172.16.0.1:27017/formio" \
  -v /path/to/project.json:/srv/formio/client/dist/project.json:ro \
  calipseo/formio

⁠Admin Account

By default the Formio API Server will use the ROOT_EMAIL and ROOT_PASSWORD environment variables to set up the default admin user account only on the initial startup of the server. The default user email is [email protected] and the default password is CHANGEME. You may pass on these parameters as environment variables or login to the client application through http://localhost:3001 using the default credentials and change it yourself.

docker run -p 3001:3001 \
  -e "MONGO=mongodb://172.16.0.1:27017/formio" \
  -e "[email protected]" \
  -e "ROOT_PASSWORD=CHANGEME" \
  calipseo/formio

⁠Custom Application

The Formio API Server can also host your own web application accesible through port 8080 using ExpressJS. To enable your application, you will need to expose your app directory to the container on /srv/formio/app/dist.

docker run -p 3001:3001 -p 8080:8080 \
  -e "MONGO=mongodb://172.16.0.1:27017/formio" \
  -v /path/to/my/app:/srv/formio/app/dist:ro \
  calipseo/formio

⁠Email Transport

The Formio API Server allows you to configure different types of email transports which allows you to configure the Email Action⁠. Use the following environment variables to define the available email transports:

KeyDescriptionDefault
EMAIL_TRANSPORTThe default email transport type to use (can select either sendgrid or mandrill).
EMAIL_USERThe default email transport username (API user for sendgrid).
EMAIL_PASSWORDThe default email transport password (API Key for sendgrid or madrill).
GMAIL_USERThe GMail transport username.
GMAIL_PASSWORDThe Gmail transport password.
SENDGRID_USERThe Sendgrid transport API user.
SENDGRID_KEYThe Sendgrid transport API key.
MANDRIL_KEYThe Mandrill transport API key.
SMTP_HOSTThe SMTP transport server host.
SMTP_PORTThe SMTP transport server port.
SMTP_SECUREWether the SMTP transport server uses SSL/TLS.
SMTP_USERNAMEThe SMTP transport username.
SMTP_PASSWORDThe SMTP transport password.
SMTP_ALLOW_UNAUTHORIZEDWether the SMTP transport should allow unauthorized / invalid certificates.

⁠Database Connectors

The Formio API Server allows to configure MySQL and MSSQL database connectors. he SQL Connector Action allows you to integrate form submissions with your own SQL based database. When a submission is created, it will be created in your database for your consumption via formio-sql⁠. Use the following environment variables to setup your database connector.

KeyDescriptionDefault
MYSQL_HOSTThe MySQL database host.
MYSQL_PORTThe MySQL database port.
MYSQL_DBNAMEThe MySQL database name.
MYSQL_USERThe MySQL database user.formio
MYSQL_PASSWORDThe MySQL database user password.CHANGEME

⁠Custom Configuration

The Formio API Server loads its default config located in /srv/formio/config/default.json (available here⁠. You may overwrite this file by exposing your own custom config file to the container or by setting the NODE_CONFIG environment variable.

⁠Using Volumes
docker run -p 3001:3001 \
  -e "MONGO=mongodb://172.16.0.1:27017/formio" \
  -v /path/to/default.json:/srv/formio/config/default.json:ro \
  calipseo/formio
⁠Using NODE_CONFIG
docker run -p 3001:3001 \
  -e "MONGO=mongodb://172.16.0.1:27.17/formio" \
  -e "NODE_CONFIG={\"mongoSecret\": \"secret\"}" \
  calipseo/formio

Tag summary

Content type

Image

Digest

Size

85.7 MB

Last updated

about 6 years ago

docker pull calipseo/formio