Docker Community Forums

Share and learn in the Docker community.

Docker-compose error

I am trying to convert the run command to a compose file but I keep running into errors

version: '3'
services:
smtprelay:
image: denispaiva/relay-o365
container_name: smtprelay
environment:
- HOSTNAME=smtprelay.xxx.local
- SMTP_LOGIN: [noreply@xxx.com](mailto:noreply@xxx.com)
- SMTP_PASSWORD: 2gZ1^l$8O5!^mw
- EXT_RELAY_HOST: smtp.office365.com
- EXT_RELAY_PORT: 587
- ACCEPTED_NETWORKS: 172.16.0.0/12 10.0.0.0/8
ports:
- '25:25'
restart: always

ERROR: Invalid interpolation format for “environment” option in service “smtprelay”: “2gZ1^l$8O5!^mw”

what am I missing to fix the error?

Can you please wrap you in a preformatted text block?
Escape your smtp_password.