#deploying express & nextjs with docker compose

1 messages · Page 1 of 1 (latest)

pliant pulsar
#

I've got a setup with two apps that I need to deploy. I've created a local docker compose that I'm using to build images and will probably use them in CI. But both images locally are working. Now, I'd like to deploy those images. So I'm pushing both images with :latest tag to the ACR (contianer registry), they are available under my.azuecr.io/my/(api or web):latest
I've tried to deploy it via cli with command az container create, then api container is running, I can see it is deployed, can access it via <ip-addres>:8080. So far so good. But the second application is not starting at all, it retries and retries, but never can start. I've checked the logs, but get a message: "No logs available".

Here is my config file. I also want to map port :3000 from the web app to the default 80, and keep :8080 accessible only for the web. How I should configure it? How I can check the logs of the container, or find a reason why it's not starting? Could it be because of the lowest plan and I can run only one container free?

apiVersion: 2018-10-01
location: swedencentral
name: my-group
properties:
  containers:
    - name: api
      properties:
        image: my.azurecr.io/my/api:latest
        ports:
          - port: 8080
        resources:
          requests:
            cpu: 1.0
            memoryInGb: 1.5
    - name: web
      properties:
        image: my.azurecr.io/my/web:latest
        ports:
          - port: 3000
        resources:
          requests:
            cpu: 1.0
            memoryInGb: 1.5
  osType: Linux
  restartPolicy: Always
  ipAddress:
    type: Public
    ports:
      - protocol: TCP
        port: 3000
      - protocol: TCP
        port: 8080
  imageRegistryCredentials:
    - server: my.azurecr.io
      username: my
      password: <paas>

pliant pulsar
#

also, when trying to run this single container, it fails too, so it's not a plan issue

sterile vault
#

Typically if you have no logs that'll point to a container issue itself or a yaml configuration

#

You mentioned running this locally works ?

pliant pulsar
#

yes, when I run this image with command docker run -d --name debug -P my.azurecr.io/my/web:latest it runs succesfully

#

@sterile vault I've tried to add env variables, but with no luck

#

still the same problem

sterile vault
#

Can you point to a specific version ?

pliant pulsar
#

you mean isntead of :latest?

#

in general I'm just staring, there are not much versions, I've pushed :0.1 and then pushed :latest tag the same version

#

but let me check

#

no luck, still the same - api is working and it can be seen in the logs.

#

0.2 = latest, 0.1 is something older

sterile vault
#

I'd point to your configuration being an issue here

#

either within your manifest file or your application src

#

You can try a higher plan to test your theory