Giter VIP home page Giter VIP logo

Comments (7)

uwej711 avatar uwej711 commented on August 22, 2024 1

No problem. I added the following content to config/deploy-templates/service/mockservices/default/mockservices.yml.twig:

  {{ serviceName }}:
    build:
      context: ./mockservices
    networks:
      - private
      - public
    labels:
      'spryker.app.name': mockservices
      'spryker.app.type': hidden
      'spryker.project': ${SPRYKER_DOCKER_PREFIX}:${SPRYKER_DOCKER_TAG}
    healthcheck:
      test: [ "CMD", "nc", "-z", "localhost", "8008" ]
      interval: 5s
      timeout: 5s
      retries: 5
    volumes:
{% include "application-volumes.yml.twig" with project %}

and the following to config/deploy-templates/nginx/http/gateway/mockservices.server.conf.twig:

{% extends "nginx/http/gateway/server.conf.twig" %}
{% block upstream %}{{ upstream }}:8008{% endblock upstream %}

Finally the following was added to deploy.yml:

services:
    mockservices:
        engine: mockservices
        endpoints:
          services.spryker.local:

There is a Dockerfile in the mockservices directory that builds a tiny flask app for developing locally ...

Now after docker/sdk boot and docker/sdk up I have my flask app running and available at services.spryker.local.

from docker-sdk.

alexanderM91 avatar alexanderM91 commented on August 22, 2024

Hi @uwej711,

I believe Docker/SDK provides required feature OOTB.
You could extend the default functionality via custom docker-compose file:

Like an example:
deploy.yml

docker:
  compose:
    yamls:
      - docker-compose.custom.yml

docker-compose.custom.yml

version: 3.7

services:

  my-custom-service:
      image:....

https://docs.docker.com/compose/extends/

I hope it will be helpful and have a great evening.

from docker-sdk.

uwej711 avatar uwej711 commented on August 22, 2024

@alexanderM91 I tried what you suggested but it does not work. See the linked PR for a solution that allows what I want to achieve.

from docker-sdk.

alexanderM91 avatar alexanderM91 commented on August 22, 2024

Hi @uwej711, could you please answer for several small questions?
How we fix an issue just with a new folder?
Why cannot we reuse deploy-templates for storing necessary service templates?

from docker-sdk.

uwej711 avatar uwej711 commented on August 22, 2024

Of course those can be placed in the same folder. But we still have to add the folder to the Twig ChainLoader, see my PR. I can easily adjust that.

from docker-sdk.

uwej711 avatar uwej711 commented on August 22, 2024

PR updated

from docker-sdk.

alexanderM91 avatar alexanderM91 commented on August 22, 2024

Hi @uwej711, thanks a lot for your contribution.
It would be great if you could provide us the examples of the configuration you did.

Thank you.

from docker-sdk.

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.