Deploy FlexIt
This repository provides everything needed to deploy FlexIt using Docker.
For Linux Installation see this guide
Prerequisites
Ensure you are able to run PowerShell as Administrator. Windows containers only run on Windows 10 or Windows Server 2022 and later.
Deployment Options
This repository allows for the following deployment options:
- With all containers: FlexIt Frontend and PostgreSQL backend.
- Without PostgreSQL: Use an external content database while deploying the FlexIt Frontend.
Required Containers
The FlexIt Analytics (flexit-analytics
) container is the only mandatory container. All other containers are optional based on your setup.
Installation Instructions
1. Clone the Repository
2. Configure Environment Variables
Rename the .env.template
file to .env
and update the following:
frontend app configuration (modification in optional, the below defaults are provided):
backend database configuration (add credentials for the containerized PostgreSQL database):
If you are using an external content database, set the
USE_CONTENT_DB_CONTAINER
variable tofalse
.
Ensure the image tag in the Dockerfile
matches the version of Windows you are using. The default is windows-ltsc2022
.
Note:
- If you are using an external content database, you will be prompted to set up the database credentials upon creating your account in FlexIt.
Installation and Setup
Installing for the first time
Run the following command in an Administrator PowerShell:
This command will install docker and docker-compose if not already installed, build the images, and start the container(s).
Access FlexIt
Visit the application at:
http://localhost:<FLEXIT_PORT>
See here for how to configure your DNS.
Managing the Docker Containers
Stopping the Application
To stop the application:
Starting the Application
To start the application:
Restarting the Application
To pull the latest changes from an upstream repo and restart the application:
Cleaning up artifacts to free up space
This section provides commands to clean up Docker artifacts, including containers and images.
stop all containers
This command will stop all running containers in your local Docker environment. Be cautious, as this will stop all containers, including those not related to this project.
delete all containers
This command will remove all containers from your local Docker environment. Be cautious, as this will delete all containers, including those not related to this project.
delete all images
This command will remove all images from your local Docker environment. Be cautious, as this will delete all images, including those not related to this project.
prune to clear up space
This command will remove all stopped containers, unused networks, dangling images, and build cache.
To remove only unused images:
To remove unused containers:
To remove unused networks:
To remove unused build cache:
Working with Volumes
The docker-compose.yml
file uses named volumes to persist data. These volumes are created automatically when you run the application and will persist between container restarts.
For example:
This creates a named volume called flexit_webcontent
that is used by the flexit-analytics
service and is mapped to the /opt/flexit/webcontent
directory in the container. This volume is owned by root and is not accessible by the user running the container. If you need to access or modify the data in this volume, you can use the docker cp
command to copy files to the container from your local machine (or vice/versa). Further documentation from Docker here
For example, to copy a file.txt file from your local machine to the flexit_webcontent
volume in the flexit-analytics
container:
You can also get into the container's shell directly to move around the filesystem if needed:
run bash from within the container (linux):
To view the volumes:
To inspect a specific volume:
Additional Notes
Viewing Logs
To view logs for the a container:
Troubleshooting
1. PostgreSQL Connection Issues
- Ensure the
DB_USER
,DB_PASSWORD
, andDB_NAME
in.env
match the values expected by the PostgreSQL server.
2. FlexIt Frontend Not Starting
Review logs:
docker logs flexit-frontend