Copy the example environment file:
cp .env.example .envEdit the .env file to set the correct secret values for your environment.
Link production config files and directories:
ln -s config_prod config
ln -s .env.nosecret-prod .env.nosecret
ln -s .env.prod .envProduction servers do not require a proxy.
docker compose --env-file ./.env.prod --env-file ./.env.nosecret-prod upor
docker compose --env-file ./.env.prod --env-file ./.env.nosecret-prod --profile with_proxy --profile barista up -dLink dev config files and directories:
ln -s config_dev config
ln -s .env.nosecret-dev .env.nosecret
ln -s .env.dev .envRunning in staging (detached mode), with the watchtower service that updates the images every 5 minutes:
docker compose -f docker-compose.yml -f docker-compose.watcher.yml --env-file ./.env up --env-file ./.env.nosecret -dReading logs in production:
docker compose logs -fThe .env.example contains latest images of the services in docker-compose and it is for development purposes.
Running outside of the production servers requires a proxy.
docker compose --env-file ./.env --env-file ./.env.nosecret --profile with_proxy upIf barista service needs to be enabled, add --profile barista to the command above.
docker compose --env-file ./.env --env-file ./.env.nosecret --profile with_proxy --profile barista upDocker compose expects several files located in config directory.
Several directories are provided for different configurations:
config_prod- production configurationconfig_dev- development configuration
To use the suitable configuration, create a symlink to the desired configuration directory:
ln -s config_prod configProxy (ssh tunnel) configuration should be placed in proxy_config directory. If nginx configuration needs extra files, they should be placed in nginx_config directory.
A special note about the database. Our setup assumes the database is accessed via an SSH tunnel to the database host. If the database port is accessible directly, you can simplify the configuration by setting the db hostname, port and credentials in the relevant config files, commenting out the mysql-tunnel section in docker-compose.yml. In this case you also do not need the files in the config/ssh folder, those are used for the DB tunnel only.
Increase the default limit of open files on the host server to increase the maximum allowed number of connections. See socket.io performance tuning.
Tags of impresso docker images are read from the .env file. The default file with all tags set to latest is provided in this repository.
When building docker container for the app make sure:
- webpack compiles the app with
PUBLIC_PATHenvironmental variable set to/app/(assuming that the app base URL innginxconfiguration is/app). BASE_URLinprod.env.jsis set to'"/app"'(assuming that the app base URL innginxconfiguration is/app).MIDDLELAYER_APIinprod.env.jsis set to'""'MIDDLELAYER_API_PATHinprod.env.jsis set to'"/api"'(assuming that middle layer API base URL innginxconfiguration is/api)MIDDLELAYER_API_SOCKET_PATHinprod.env.jsis set to'"/api/socket.io/"'(assuming that middle layer API base URL innginxconfiguration is/api)MIDDLELAYER_MEDIA_PATHinprod.env.jsis set to'"/api/media"'(assuming that the api base URL innginxconfiguration is/api)