Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make docker-compose yml file #3

Open
afolarin opened this issue Jul 5, 2015 · 2 comments
Open

Make docker-compose yml file #3

afolarin opened this issue Jul 5, 2015 · 2 comments

Comments

@afolarin
Copy link
Member

afolarin commented Jul 5, 2015

Option to automate post build deploy step with docker-compose

@afolarin
Copy link
Member Author

Also would be helpful to use the networking flag... [file under TODO when this is ready compose feature is ready out of experimental]

@emegodoyr
Copy link

emegodoyr commented Apr 18, 2017

https://redcap.ci3.cl is ditributed in ec2 container (Amazon Web Service) with dockerfile, the next file is a docker-compose example for you redcap, is more fast and the dump is consumable from endpoint

version: '2'
services:
  redcap:
    container_name: redcap
    hostname: "redcap"
    image: webdevops/php-nginx:7.0
    ports:
      - "80:80"
    volumes:
      - "./www:/app"
    depends_on:
      - mysql

  mysql:
    container_name: mysql_redcap
    hostname: "mysql_redcap"
    image: mysql:5.7
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: redcap_pass
      MYSQL_DATABASE: redcap_db
      MYSQL_USER: redcap_user
      MYSQL_PASSWORD: redcap_pass
    volumes:
      - data:/var/lib/mysql
      - ./config/mysqld.cnf:/etc/mysql/mysql.conf.d/mysqld.cnf
      - ./dump:/docker-entrypoint-initdb.d
volumes:
  data:

- ./dump:/docker-entrypoint-initdb.d , in this line, the dump it's provided from localhost, can you change ./dump for you endpoint database dump (.sql)

an the next file is the configuration for you mysql instance:

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA

#
# The MySQL  Server configuration file.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

[mysqld]
pid-file	= /var/run/mysqld/mysqld.pid
socket		= /var/run/mysqld/mysqld.sock
datadir		= /var/lib/mysql
#log-error	= /var/log/mysql/error.log
# By default we only accept connections from localhost
#bind-address	= 127.0.0.1
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
max_allowed_packet=200M

note: the database is not expose (DMZ) for security, for expose database endpoint and read data from external service, you need expose the port 3306, who? add the next line in docker-compose.yml

ports:
      - "3306:3306"

the port describe in the left is for the host and the right is for container (internal port run PID mysql)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants