-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NEW FEATURE] Docker swarm support #53
Comments
I've not setup/used a Docker Swarm before, would you be able to provide a simple example configuration? |
Here as a sample configuration. version: "3.3"
services:
database_service:
image: mysql:5.7
volumes:
- db_data_volume:/var/lib/mysql
networks:
internal_network:
aliases:
- database_alias
ports:
- "3308:3306"
deploy:
placement:
constraints:
- node.labels.database == true
replicas: 1
restart_policy:
condition: any
environment:
MYSQL_DATABASE: app_database_name
MYSQL_USER: app_db_user
MYSQL_PASSWORD_FILE: /run/secrets/db_password_secret
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/db_root_password_secret
command:
[
--character-set-server=utf8,
--collation-server=utf8_general_ci,
--sql-mode=STRICT_TRANS_TABLES,
]
secrets:
- db_password_secret
- db_root_password_secret
app_service:
image: app_image:latest
volumes:
- app_documents_volume:/documents
networks:
internal_network:
aliases:
- app_service_alias
external_network:
aliases:
- app_external_alias
deploy:
placement:
constraints:
- node.labels.application == true
replicas: 1
restart_policy:
condition: any
configs:
- source: app_config_file
target: /path/to/config.properties
- source: app_persistence_file
target: /path/to/persistence.properties
networks:
internal_network:
external_network:
external: true
secrets:
db_password_secret:
external: true
db_root_password_secret:
external: true
configs:
app_config_file:
file: ../config.properties
app_persistence_file:
file: ../persistence.properties
volumes:
db_data_volume:
driver: local
driver_opts:
o: bind
type: none
device: /path/to/db_data_directory
app_documents_volume:
driver: local
driver_opts:
o: bind
type: none
device: /path/to/documents_directory its similiar to compose, but have some features to be used in production. Here is a script to setup a project locally: #!/bin/sh
IP_ADDRESS=$(ip -4 addr show scope global | grep inet | awk '{print $2}' | cut -d/ -f1 | head -n 1)
if [ -z "$IP_ADDRESS" ]; then
echo "Error: Was not possible to obtain the IP address."
exit 1
fi
echo "Initializing Docker Swarm with IP: $IP_ADDRESS..."
docker swarm init --advertise-addr "$IP_ADDRESS" || echo "Swarm already initialized."
echo "Creating networks..."
docker network create -d overlay database || echo "Network 'database' already exists"
docker network create -d overlay my-network || echo "Network 'my-network' already exists"
echo "Creating secrets..."
echo "passwork" | docker secret create db_password_secret -
echo "rootpass" | docker secret create db_root_password_secret -
echo "Deploying stack..."
docker stack deploy -c compose-dev.yml my-stack
echo "Process completed!" waiting for this feature! |
Don't hold your breathe, but I'll have a look into it |
I have a basic service set up, I've not used Docker swarm before, what features do you think would be essential to implement into |
Taking swarmpit as en example, I would like to see all services, and zooming into one of them would allow me to see its parameters, replicas, status.... |
It would also be cool to see other docker things like:
|
Describe the solution you'd like
Docker swarm support to monitor services and manage them like a container.
Describe alternatives you've considered
As an alternative I'm currently using web-based tools like like swarmpit or portainer.
The text was updated successfully, but these errors were encountered: