Giter Site home page Giter Site logo

Comments (13)

jaltek avatar jaltek commented on June 11, 2024 1

If you are going to edit the README because of the nginx-fpm example maybe you should replace the

links:
      - app

flag in flavor of version 3 of the compose file.
Quote:

The --link flag is a legacy feature of Docker. It may eventually be removed. Unless you absolutely need to continue using it, we recommend that you use user-defined networks to facilitate communication between two containers instead of using --link. One feature that user-defined networks do not support that you can do with --link is sharing environmental variables between containers. However, you can use other mechanisms such as volumes to share environment variables between containers in a more controlled way.

Ref: https://docs.docker.com/compose/compose-file/#links

Maybe something like:

version: '3'

services:
  db:
    image: mariadb
    restart: always
    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_USER=friendica
      - MYSQL_PASSWORD=
      - MYSQL_DATABASE=friendica
      - MYSQL_RANDOM_ROOT_PASSWORD=yes
    networks:
      main:
        aliases:
          - db

  app:
    image: friendica/server:fpm
    restart: always
    volumes:
      - friendica:/var/www/html    
    environment:
      - MYSQL_HOST=db
      - MYSQL_PORT=3306
      - MYSQL_USER=friendica
      - MYSQL_PASSWORD=
      - MYSQL_DATABASE=friendica
      - [email protected]
    hostname: friendica.local
    depends_on:
      - db
    networks:
      main:
        aliases:
          - app

  web:
    image: nginx
    ports:
      - 8080:80
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
    volumes_from:
      - app
    restart: always
    networks:
      main:
        aliases:
          - web

volumes:
  db:
  friendica:

networks:
  main:

from docker.

jaltek avatar jaltek commented on June 11, 2024 1

from docker.

jaltek avatar jaltek commented on June 11, 2024 1

IMHO yes. Thx!

from docker.

nupplaphil avatar nupplaphil commented on June 11, 2024

Did you create a local nginx.conf before starting?

from docker.

jaltek avatar jaltek commented on June 11, 2024

No (I figured that's where the mistake was). If this is a prerequisite maybe it should be mentioned in the README :)

from docker.

nupplaphil avatar nupplaphil commented on June 11, 2024

Hm.. There is a sentence about looking for examples in the examples folder.

But I will write it more clear / prominent :-)

from docker.

jaltek avatar jaltek commented on June 11, 2024

Well - I first assumed it will run out of the box like the apache example without any further configuration.
A docker compose example YAML file tempts you to try it out quickly :)

from docker.

nupplaphil avatar nupplaphil commented on June 11, 2024

I will change the link to the custom network linking, but I don't want to change the version to "3" because there are currently a lot of version 2 docker-compose configs out there.

When you make a nginx.conf file with the help of one of the examples and start it with the given docker-compose file, is the docker environment working?

from docker.

nupplaphil avatar nupplaphil commented on June 11, 2024

There is a new description in the README for using this example.

from docker.

jaltek avatar jaltek commented on June 11, 2024

Works perfect :)

But the compose example from README differs from .examples/docker-compose/insecure/mariadb-cron-smtp/fpm/docker-compose.yml or was that on purpose?

from docker.

nupplaphil avatar nupplaphil commented on June 11, 2024

Thanks for the feedback :-)

Yes, because the example-files are more like a "template" for everybody. So there are more environment variables to consider and the db-credentials are in a separated file.

The docker-compose examples in the README are for "quick&dirty" setups.

In the near future, I will make docker-compose files with traefik as a ACME(Let's encrypt) and Reverse Proxy (=> secure docker-compose files ;-) )

from docker.

nupplaphil avatar nupplaphil commented on June 11, 2024

@jaltek Can I close this issue? Is the answer for the README suitable for you?

from docker.

pianic26 avatar pianic26 commented on June 11, 2024

I have the same problem; I'm new with docker and I don't how to fix please help
ERROR: for firstproject-webserver Cannot start service webserver: OCI runtime create failed: container_linux.go:345: starting container process caused "process_linux.go:424: container init caused "rootfs_linux.go:58: mounting \"/c/firstproject/phpdocker/nginx/nginx.conf\" to rootfs \"/mnt/sda1/var/lib/docker/overlay2/ccb70cb832f49a81d583eb3e389371e01865cb6ab9ae7dd4a923d4f434a9361c/merged\" at \"/mnt/sda1/var/lib/docker/overlay2/ccb70cb832f49a81d583eb3e389371e01865Creating firstproject-php-fpm ... done
u trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected tCreating firstproject-mysql ... done
docker-compose.txt

from docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.