Hi have deployed my app in pre-prod env, I have a frontend and backend, I’m using docker image for front, back, and Nginx.
But the frontend service can’t fetch the backend endpoint, but when I connect the local frontend to my pre-prod backend it works well but it isn’t the same behavior with the pre-prod frontend.
i have this error when i log the front container :
---> ERROR > Network error: request to https://mydomain.dev/graphql failed, reason: connect ETIMEDOUT 161.35.150.4:443
docker-compose.yml
# path: ./docker-compose.yml
version: '3'
services:
certbot:
image: certbot/certbot:latest
volumes:
- ./certbot/www/:/var/www/certbot/:rw
- ./certbot/conf/:/etc/letsencrypt/:rw
frontend:
container_name: frontend
image: mydockerhub/app-front:latest
restart: always
ports:
- 3000:3000
networks:
- strapi
backend:
container_name: backend
build: .
image: mydockerhub/app-back
restart: always
env_file: .env
environment:
DATABASE_CLIENT: ${DATABASE_CLIENT}
DATABASE_HOST: myDB
DATABASE_PORT: ${DATABASE_PORT}
DATABASE_NAME: ${DATABASE_NAME}
DATABASE_USERNAME: ${DATABASE_USERNAME}
DATABASE_PASSWORD: ${DATABASE_PASSWORD}
JWT_SECRET: ${JWT_SECRET}
ADMIN_JWT_SECRET: ${ADMIN_JWT_SECRET}
APP_KEYS: ${APP_KEYS}
NODE_ENV: ${NODE_ENV}
ports:
- '1337:1337'
networks:
- strapi
depends_on:
- myDB
volumes:
- ./app:/srv/app
myDB:
container_name: myDB
platform: linux/amd64 #for platform error on Apple M1 chips
restart: unless-stopped
env_file: .env
image: mysql:5.7
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_ROOT_PASSWORD: ${DATABASE_PASSWORD}
MYSQL_PASSWORD: ${DATABASE_PASSWORD}
MYSQL_DATABASE: ${DATABASE_NAME}
volumes:
- strapi-data:/var/lib/mysql
#- ./data:/var/lib/mysql # if you want to use a bind folder
ports:
- '13306:3306'
networks:
- strapi
webserver:
container_name: webserver
image: nginx:latest
ports:
- 80:80
- 443:443
networks:
- strapi
restart: always
depends_on:
- frontend
- backend
volumes:
- ./nginx/conf/nginx.conf:/etc/nginx/nginx.conf:ro
- ./certbot/www:/var/www/certbot/:ro
- ./certbot/conf/:/etc/nginx/ssl/:ro
volumes:
strapi-data:
networks:
strapi:
name: Strapi
driver: bridge