Skip to content
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

Support process.env #24

Open
humiyan02 opened this issue Aug 15, 2022 · 0 comments
Open

Support process.env #24

humiyan02 opened this issue Aug 15, 2022 · 0 comments

Comments

@humiyan02
Copy link

I want to use process.env for port mapping.

version: '3.9'

services:
  wordpress_with_theme_db:
    image: mysql:8.0
    volumes:
      - db_data:/var/lib/mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: wordpress
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: wordpress

  wordpress_with_theme_wordpress:
    depends_on:
      - wordpress_with_theme_db
    image: wordpress:latest
    ports:
      - '${HOST_PORT_FOR_COMPOSE}:80'
    restart: always
    volumes_from:
      - wordpress_with_theme_db:ro
    environment:
      WORDPRESS_DB_HOST: wordpress_with_theme_db:3306
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress
      WORDPRESS_DB_NAME: wordpress

below error occur when compose up.

Error: (HTTP code 400) unexpected - invalid port specification: "${HOST_PORT_FOR_COMPOSE}" 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant