To support docker deployment for map-egypt services.
- Docker (version 19.03.0+)
- Docker Compose (version 1.27.0+)
The project consists of four main services:
- Database (PostgreSQL): Stores application data
- Site: Frontend web application
- API: Backend API service
- Admin: Administration interface
This project uses two persistent volumes:
pgdata
: Stores PostgreSQL database filesuploaded
: Stores files uploaded through the API
git clone https://github.com/cartologic/map-egypt-docker.git
cd map-egypt-docker
Make sure the API environment file exists:
# Verify that the .env file exists in the api directory
ls -la ./api/.env
If the file doesn't exist, create it with the necessary environment variables.
docker-compose up -d
This command builds and starts all services in detached mode. The first run will take longer as it needs to build the images.
Check if all services are running properly:
docker-compose ps
- Site: http://localhost:9023
- Admin Interface: http://localhost:9021
- API: http://localhost:9011
- Database: Available on port 9044 (connect using a PostgreSQL client)
- PostgreSQL data:
./pgdata
(mapped to/var/lib/postgresql/data
in the container) - Uploaded files:
./uploaded
(mapped to/app/uploaded
in the API container)
# Stop the services but keep the volumes
docker-compose down
# Stop the services and remove the volumes (CAUTION: This will delete all data)
docker-compose down -v
# View logs for all services
docker-compose logs
# View logs for a specific service
docker-compose logs [service_name]
# Follow logs in real-time
docker-compose logs -f [service_name]
# Restart a specific service
docker-compose restart [service_name]
# Restart all services
docker-compose restart
If you've made changes to the source code and need to rebuild:
docker-compose build [service_name]
docker-compose up -d [service_name]