Skip to content

Instantly share code, notes, and snippets.

@ronaldomendes
Last active June 27, 2025 02:49
Show Gist options
  • Save ronaldomendes/9fb4ab32794fd1b84fbe496c012e883f to your computer and use it in GitHub Desktop.
Save ronaldomendes/9fb4ab32794fd1b84fbe496c012e883f to your computer and use it in GitHub Desktop.
Some commands to ease your development using Docker.

Main Docker images for web development

Mailpit installation

  • Run the following command:
docker run -d --name mailpit --restart unless-stopped -p 8025:8025 -p 1025:1025 axllent/mailpit
Python env file example:
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_PORT=1025
MAIL_FROM=[email protected]
MAIL_SERVER=localhost
MAIL_FROM_NAME="Contact"
MAIL_STARTTLS=False
MAIL_SSL_TLS=False
USE_CREDENTIALS=False
VALIDATE_CERTS=False
Spring boot application example:
spring.mail.host=localhost
spring.mail.port=1025
spring.mail.username=
spring.mail.password=
spring.mail.protocol=smtp

Neo4j installation

  • Run the following command:
docker run --name neo4j-docker -p 7474:7474 -p 7687:7687 -d --env NEO4J_AUTH=neo4j/secret123 neo4j:latest

MySQL installation

  • Run the following command:
docker run -p 3307:3306 --name mysql8-server -e MYSQL_ROOT_PASSWORD=m45t3r -d mysql/mysql-server:8.0.29
  • Access MySQL container:
Executar o MySQL: docker exec -it mysql8-server /bin/bash
  • Access MySQL database:
mysql -uroot -p -A
  • Optional - Verify root user data:
select user, host from mysql.user;
  • Update root user data
update mysql.user set host='%' where user = 'root';
  • Update user privileges
flush privileges;

RabbitMQ installation

  • Basic RabbitMQ image installation:
docker run -d --name rabbit-docker -p 15672:15672 -p 5672:5672 -e RABBITMQ_DEFAULT_USER=master -e RABBITMQ_DEFAULT_PASS=m45t3r rabbitmq:3.12-management
  • Install RabbitMQ with Streams:
docker run -d --restart always --name rabbit-streams --hostname docker-rabbitmq -p 5672:5672 -p 15672:15672 -p 5552:5552 -e RABBITMQ_DEFAULT_USER=master -e RABBITMQ_DEFAULT_PASS=m45t3r -e RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS="-rabbitmq_stream advertised_host localhost" rabbitmq:3.12-management
  • Access the terminal and add this command: docker exec -it rabbit-streams bash
  • Enable the streams plugin with this command: rabbitmq-plugins enable rabbitmq_stream

Postgres + PgAdmin

Optional:

  • If you want to remove all containers before starting, run the following command:
docker system prune -a

Create a network

In my case, I named as web-network

docker network create --driver bridge web-network

Install PostgreSQL

Run the following command to download and install Postgres with the most recent version. In my case, I named the Postgres image as web-postgres. You also may change the default user and password.

docker run --name web-postgres --network=web-network -p 5432:5432 -e POSTGRES_PASSWORD=root -e POSTGRES_USER=root -d postgres

Install PgAdmin

Before running the following command, you can make several changes, such as:

  • Image name: web-pgadmin
  • External port: 8887
  • Default email: [email protected]
  • Default password: root
  • Network name: web-network
docker run --name web-pgadmin --network=web-network -p 8887:80 -e [email protected] -e PGADMIN_DEFAULT_PASSWORD=root -d dpage/pgadmin4

After the installation process, you can access PgAdmin application through your browser with the url: http://localhost:8887 or another port that you configured in the previous steps.

While you are registering the database settings, make sure to add in the field Connection - Host name/address the same name of your Postgres container. In my case, web-postgres.

| Credits: Prof. Diego Pinho - Programação Brazilian Portuguese tutorial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment