Cet article est utilisé pour l'explication dans la vidéo (https://youtu.be/-DrdYw8fHwc) Ceci est un article de la diapositive. Veuillez le voir avec la vidéo.
#Utilisez l'image de centos7
FROM centos:7
LABEL maintainer=Takemi
SHELL ["/bin/bash", "-o", "pipefail", "-c"]"
#Effectuer des mises à jour cumulatives
RUN yum -y upgrade
#Si l'utilisateur takemi n'existe pas, ajoutez l'utilisateur
RUN echo 'make user takemi'
RUN adduser -m takemi;echo "takemi:takemi123" | chpasswd;
#Installer ssh
RUN yum install -y openssh-server
RUN systemctl enable sshd
#Installer Apache
RUN yum install -y httpd
RUN systemctl enable httpd
#Installation de MariaDB
RUN curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | bash
RUN yum install -y MariaDB-server MariaDB-devel MariaDB-shared
RUN systemctl enable mariadb
#préparation rubis pour l'installation
RUN yum -y groupinstall "Development Tools"
RUN yum -y install openssl-devel readline-devel zlib-devel curl-devel libyaml-devel libffi-devel
RUN yum -y install httpd-devel
RUN yum -y install ImageMagick ImageMagick-devel ipa-pgothic-fonts
WORKDIR /root
RUN curl -O https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.1.tar.gz
RUN tar xf ruby-2.4.1.tar.gz
WORKDIR /root/ruby-2.4.1
RUN ./configure --disable-install-doc
RUN make
RUN make install
RUN gem install bundler --no-rdoc --no-ri
> docker build -t redmine .
Ajouter un utilisateur root pour DB
root > mysql
mysql > GRANT ALL PRIVILEGES ON *.* TO 'takemi'@'localhost' IDENTIFIED BY 'takemi123' WITH GRANT OPTION;
mysql > FLUSH PRIVILEGES;
root > cd /var/www
root > svn co https://svn.redmine.org/redmine/branches/4.1-stable redmine-4.1
user > cd redmin-4.1
user > cd config
user > cp configuration.yml.example configuration.yml
user > cp database.yml.example database.yml
user > vi database.yml
username: takemi
password: "takemi123"
root > cd /var/www
root > chown -R takemi:takemi redmine-4.1
root > vi /etc/group
takemi:x:1000:apache
root > cd /var/www/redmine-4.1
root > gem install mysql2 -v '0.5.3' --source 'https://rubygems.org/'
root > bundle install --without development test --path vendor/bundle
root > bundle exec rake generate_secret_token
root > gem install passenger --no-rdoc --no-ri
root > passenger-install-apache2-module --auto
root > passenger-install-apache2-module --snippet
root > vi /etc/httpd/conf.d/redmine.conf
root > systemctl restart httpd
user > mysql -p
create database redmine default character set utf8;
user > RAILS_ENV=production bundle exec rake db:migrate
user > RAILS_ENV=production REDMINE_LANG=ja bundle exec rake redmine:load_default_data
Accédez avec un navigateur! Voir la vidéo pour plus de détails!
Recommended Posts