I recently push some codes (irrelevant to my docker/pipeline files), then my pipeline started failing first with an error that suggested docker-compose not found. So I changed my commands to “docker compose”. Now I am getting an error which I can’t fix.
I am using github actions and docker to deploy my app to my server. Everything runs with no problem up to the last line of my pipeline which produce the following.
Github Action error:
`======CMD======
docker stack deploy --prune --resolve-image=always --with-registry-auth -c /tmp/docker-stack-say-nes-8d71c6835cf0d610df0b49be3291eeeaa0100e4d.yml say-nes
======END======
err: WARNING: Error loading config file: open /home/***/.docker/config.json: permission denied
err: (root) Additional property name is not allowed`
My compose file:
version: '3.6'
services:
api:
image: ${CONTAINER_IMAGE:-backend}
volumes:
- uploads_volume:/usr/src/app/uploads
environment:
PORT: 3000
DB_HOST: db
DB_USER: postgres
DB_NAME: sa_dapp
DB_PASS_FILE: /run/secrets/postgres-password
secrets:
- postgres-password
networks:
- default
- traefik-public
configs:
- source: nest-config
target: /usr/src/app/.env
deploy:
replicas: 1
update_config:
parallelism: 1
order: start-first
placement:
constraints:
- node.labels.${ENVIRONMENT} == true
mode: replicated
labels:
- traefik.enable=true
- traefik.docker.network=traefik-public
- traefik.constraint-label=traefik-public
- traefik.http.routers.${STACK_NAME}-api-http.entrypoints=http
- traefik.http.routers.${STACK_NAME}-api-http.rule=Host(`${DOMAIN?Variable not set}`)
- traefik.http.routers.${STACK_NAME}-api-http.service=${STACK_NAME}-api
- traefik.http.routers.${STACK_NAME}-api-http.middlewares=https-redirect
- traefik.http.routers.${STACK_NAME}-api.entrypoints=https
- traefik.http.routers.${STACK_NAME}-api.rule=Host(`${DOMAIN?Variable not set}`)
- traefik.http.routers.${STACK_NAME}-api.service=${STACK_NAME}-api
- traefik.http.routers.${STACK_NAME}-api.tls=true
- traefik.http.routers.${STACK_NAME}-api.tls.certresolver=le
- traefik.http.services.${STACK_NAME}-api.loadbalancer.server.port=3000
db:
image: postgres:12
secrets:
- postgres-password
environment:
POSTGRES_DB: sa_dapp
POSTGRES_USER: postgres
POSTGRES_PASSWORD_FILE: /run/secrets/postgres-password
volumes:
- postgres_volume:/var/lib/postgresql/data
deploy:
replicas: 1
update_config:
parallelism: 1
order: stop-first
placement:
constraints:
- node.labels.${ENVIRONMENT} == true
volumes:
postgres_volume:
uploads_volume:
networks:
traefik-public:
external: true
secrets:
postgres-password:
name: ${STACK_NAME}-postgres-password
external: true
configs:
nest-config:
name: ${STACK_NAME}.env
external: true```
changed `docker-compose` to `docker compose`
Ehsan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.