Local Deployment

Local Deployment Script

With all this information, below is a quick script that can be ran from your machine to quickly spin up an entire Form.io platform within your local environment.

docker network create formio || true && \
mkdir ~/opt/mongodb || true && \
docker run -itd \
--name formio-mongo \
--network formio \
--volume ~/opt/mongodb:/data/db \
--restart unless-stopped \
mongo && \
docker run -d \
-e "LICENSE_KEY=YOURLICENSE" \
-e "MONGO=mongodb://mongo:27017/formio" \
-e "PORTAL_ENABLED=true" \
-e "ADMIN_PASS=CHANGEME" \
-e "DB_SECRET=CHANGEME" \
-e "JWT_SECRET=CHANGEME" \
-e "PDF_SERVER=http://pdf-server:4005" \
--restart unless-stopped \
--link pdf-server:pdf-server \
--network formio \
--name formio-server \
-p 3000:80 \
formio/formio-enterprise && \
mkdir ~/minio/data || true && \
mkdir ~/minio/config || true && \
docker run -itd \
-e "MINIO_ACCESS_KEY=CHANGEME" \
-e "MINIO_SECRET_KEY=CHANGEME" \
--network formio \
--name formio-minio \
--restart unless-stopped \
-p 9000:9000 \
-v ~/minio/data:/data \
-v ~/minio/config:/root/.minio \
minio/minio server /data && \
docker run -itd \
-e "LICENSE_KEY=YOURLICENSE" \
-e "MONGO=mongodb://mongo:27017/formio" \
-e "FORMIO_S3_SERVER=minio" \
-e "FORMIO_S3_PORT=9000" \
-e "FORMIO_S3_BUCKET=formio" \
-e "FORMIO_S3_KEY=CHANGEME" \
-e "FORMIO_S3_SECRET=CHANGEME" \
--network formio \
--link formio-mongo:mongo \
--link formio-minio:minio \
--restart unless-stopped \
--name pdf-server \
-p 4005:4005 \
formio/pdf-server;

Docker Compose Script

โ€‹Docker compose can also be used to deploy the Form.io platform into your environment. Here is an example script that can be used to deploy Form.io using Docker Compose.

version: '3.7'
services:
mongo:
image: mongo:4.1
restart: always
volumes:
- mdb-data:/data/db
minio:
image: minio/minio
restart: always
volumes:
- minio-data:/data
- minio-config:/root/.minio
ports:
- "9000:9000"
environment:
MINIO_ACCESS_KEY: CHANGEME
MINIO_SECRET_KEY: CHANGEME
command: server /data
formio-server:
image: formio/formio-enterprise
restart: always
links:
- mongo
ports:
- "3000:80"
environment:
LICENSE_KEY: YOURLICENSE
PORTAL_ENABLED: 1
MONGO: mongodb://mongo:27017/formio
ADMIN_EMAIL: [email protected]
ADMIN_PASS: CHANGEME
PDF_SERVER: http://pdf-server:4005
pdf-server:
image: formio/pdf-server
restart: always
links:
- mongo
- minio
ports:
- "4005:4005"
environment:
LICENSE_KEY: YOURLICENSE
MONGO: mongodb://mongo:27017/formio
FORMIO_S3_SERVER: minio
FORMIO_S3_PORT: 9000
FORMIO_S3_BUCKET: formio
FORMIO_S3_KEY: CHANGEME
FORMIO_S3_SECRET: CHANGEME
volumes:
mdb-data:
minio-data:
minio-config:

You will want to ensure that you replace all CHANGEME text with different text. Once you have done this, you will then save this code within a docker-compose.yml file, and then run the following.

docker-compose stop
docker-compose rm
docker-compose up