Upload docker-compose.yml file to docker hub [duplicate]

  docker, docker-compose, dockerhub

I am trying to sign and upload a docker-compose.yml to docker-hub, I have been looking and only images can be uploaded so I have searched for how to create images from a docker-compose.yml but I can’t find anything, I have tried the command: docker-compose build but it doesn’t create a full image for me just from the php part

Here is the docker-compose.yml file just in case it doesn’t work due to a bug

version: '3'

networks:
    LEMP:

services:
    nginx:
        image: nginx:stable-alpine
        container_name: LEMP_nginx
        ports:
            - "80:80"
        volumes:
            - ./app:/app
            - ./nginx/default.conf:/etc/nginx/conf.d/default.conf
        depends_on:
            - php
        networks:
            - LEMP

    php:
        # image: php:7-fpm-alpine
        build: ./php
        container_name: LEMP_php
        volumes:
            - ./app:/app
        ports:
            - "9000:9000"
        networks:
            - LEMP


    mysql:
        image: mysql:latest
        container_name: LEMP_mysql
#        command: --default-authentication-plugin=mysql_native_password
        volumes:
            - ./database:/docker-entrypoint-initdb.d
        ports:
            - "3307:3306"
        depends_on:
            - nginx
        environment:
            - MYSQL_ROOT_PASSWORD=admin123
        networks:
            - LEMP

    phpmyadmin:
        image: phpmyadmin/phpmyadmin
        container_name: LEMP_phpmyadmin
        ports:
            - "8000:80"
        environment:
            PMA_ARBITRARY: 1
        depends_on:
            - mysql
        networks:
            - LEMP

And this is my Dockerfile for PHP

FROM php:7-fpm-alpine
RUN docker-php-ext-install mysqli pdo pdo_mysql

Source: Docker Questions

LEAVE A COMMENT