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

New docker-compose syntax ? #448

Closed
prigal opened this issue May 6, 2016 · 3 comments
Closed

New docker-compose syntax ? #448

prigal opened this issue May 6, 2016 · 3 comments

Comments

@prigal
Copy link

prigal commented May 6, 2016

Hello,

Can someone please provide a clean docker-compose syntax example since release 0.3.0 ?

I have multiple projects on my machine, I have to run a container doing proxy but how can I describe each of my docker-compose.yml ?

This is on of mine for an old php53 app :

version: '2'
services:
    db:
        image: mysql
        ports:
            - "3306:3306"
        environment:
            MYSQL_ROOT_PASSWORD: pass
            MYSQL_DATABASE: mydb
            MYSQL_USER: myuser
            MYSQL_PASSWORD: mypass
    php:
        build: ./config/docker/docker-php-5.3
        expose:
            - "9000"
        volumes:
            - .:/var/www/html
        links:
            - db
    nginx:
        build: ./config/docker/nginx
        expose:
            - "80"
        links:
            - php
        volumes_from:
            - php
        volumes:
            - ./logs/nginx/:/var/log/nginx
        environment:
            VIRTUAL_HOST: 'www.myapp.dev' 

I have to do docker-compose up and then start the proxy to have it redirecting me to my app, but I think there is something wrong because nginx container can't catch the domain name. (My nginx vhost isn't working, default nginx page is displayed. I suppose domain name isn't understood by my nginx container. I may have an config error on my nginx container but before I want to be sure my docker-compose is OK.)

Thank you !

@wader
Copy link

wader commented May 6, 2016

Default with the new compose syntax each project will be on it's own network. Have a look at the "Multiple Networks" section in the README and https://docs.docker.com/compose/compose-file/#networks.

@mickaelperrin
Copy link

@tkw1536
Copy link
Collaborator

tkw1536 commented Apr 10, 2022

Resolved by documentation, closing.

@tkw1536 tkw1536 closed this as completed Apr 10, 2022
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

4 participants