Why my docker-compose build is failing when copying files

Advertisements I have a project that is running just fine using fastAPI (main.py). Now I want to share it as a docker image. Here is what I am doing: My project has this structure: project │ docker-compose.yaml | requirements.txt │ └───<dir>services │ └───<dir>api | │ Dockerfile | │ main.py | | | <dir>model | file.model… Read More Why my docker-compose build is failing when copying files

Ubuntu docker with multiple mysql container

Advertisements I hope you could help me. I’m trying to setup a docker with multiple MySQL container in ubuntu server. docker-compose.yml version: ‘3.1’ services: mysql-db_1: image: mysql:8.0.28-debian command: –sql_mode="" –default-authentication-plugin=mysql_native_password restart: always ports: – ‘3306:3306’ volumes: – ./data_1/files:/var/lib/mysql-files – ./data_1/data:/var/lib/mysql mysql-db_2: image: mysql command: –sql_mode="" –default-authentication-plugin=mysql_native_password restart: always ports: – ‘3307:3307’ volumes: – ./data_2/files:/var/lib/mysql-files -… Read More Ubuntu docker with multiple mysql container

Docker-Compose with PHP and Nginx not working on production

Advertisements I have a very simple config in docker-compose with php:7-fpm and nginx that I want to use to host simple php websites. Can someone please tell me what I did wrong? Here is docker-compose.prod.yml: version: ‘3.8’ services: web: image: nginx:latest ports: – "8080:80" volumes: – ../nurock/hidden_creste:/code – ./site.prod.conf:/etc/nginx/conf.d/default.conf php: image: php:7-fpm volumes: – ../nurock/hidden_creste:/code… Read More Docker-Compose with PHP and Nginx not working on production

Rails on Docker: ActiveRecord::ConnectionNotEstablished: could not translate host name to address: Try again

Advertisements I’m trying to dockerize my Ruby on Rails API, the output of the command "docker-compose ps" is this: Since the containers are up, I tried to migrate my database use this command "docker-compose exec app bundle exec rails db:setup db:migrate", the output I got is this: About my config file, this is my Dockerfile:… Read More Rails on Docker: ActiveRecord::ConnectionNotEstablished: could not translate host name to address: Try again

Network Docker-Compose

Advertisements I have a docker-compose with a bridge network called mdb_default, where I have a database. I want to deploy another docker-compose that connects to that network that already exists, but I don’t know how to define it in the docker-compose. My file is: supeset: container_name: superset build: . restart: always depends_on: – mariadb environment:… Read More Network Docker-Compose

How to force-recreate and start only one container under docker-compose?

Advertisements After I make any code change, my typical development steps are: Change code and build the jar file Build docker image that consumes the jar file Kill current "docker-compose up" command. Run "docker-compose up" again. My docker-compose file has five services. On step 3, all the containers go down. Ideally, I just need to… Read More How to force-recreate and start only one container under docker-compose?

What is the real memory available in Docker container?

Advertisements I’ve run mongodb service via docker-compose like this: version: ‘2’ services: mongo: image: mongo environment: MONGO_INITDB_ROOT_USERNAME: root MONGO_INITDB_ROOT_PASSWORD: example mem_limit: 4GB If I run docker stats I can see 4 GB allocated: CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS cf3ccbd17464 michal_mongo_1 0.64% 165.2MiB / 4GiB… Read More What is the real memory available in Docker container?

Docker image wait for postgres image to start – without Bash

Advertisements I have a standard Python docker image that needs to start after postgers is properly started in its standard image. I understand that I can add this Bash command in the docker-compose file: command: bash -c ‘while !</dev/tcp/db/5432; do sleep 1; done; npm start’ depends_on: – mypostgres But I don’t have bash installed in… Read More Docker image wait for postgres image to start – without Bash