Copy the example environment file:
cp .env.example .env
Edit the .env
file to set the correct secret values for your environment.
Production servers do not require a proxy.
docker compose --env-file ./.env --env-file ./.env.nosecret up
or
docker compose --env-file ./.env --env-file ./.env.nosecret up -d
Running 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 -d
Reading logs in production:
docker compose logs -f
The .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 up
If 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 up
Docker 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 config
Proxy (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 here.
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_PATH
environmental variable set to/app/
(assuming that the app base URL innginx
configuration is/app
). BASE_URL
inprod.env.js
is set to'"/app"'
(assuming that the app base URL innginx
configuration is/app
).MIDDLELAYER_API
inprod.env.js
is set to'""'
MIDDLELAYER_API_PATH
inprod.env.js
is set to'"/api"'
(assuming that middle layer API base URL innginx
configuration is/api
)MIDDLELAYER_API_SOCKET_PATH
inprod.env.js
is set to'"/api/socket.io/"'
(assuming that middle layer API base URL innginx
configuration is/api
)MIDDLELAYER_MEDIA_PATH
inprod.env.js
is set to'"/api/media"'
(assuming that the api base URL innginx
configuration is/api
)