docker-compose

搭建私人博客

社会主义新天地 提交于 2019-12-11 11:55:08
目录 使用docker教你搭建私人博客 一、前言 二、环境 三、安装步骤 1. 安装docker 2.准备docker-compose.yml 3. 拉镜像 4. 登录wordpress进行配置 5. 开启wordpress对https的支持 四、其他问题 1. wp-postview统计 2. 其它统计 使用docker教你搭建私人博客 博客地址 https://www.lightingsui.com 一、前言 这个搭建私人博客可以说折腾了三回了,我的博客是放在阿里云服务器上的,但是第一次搭建被我搞垮是因为我买了一个域名,想开启https的支持,结果一不小心错误的执行了rm命令,我自己面壁了好几天。我通过这件事悟出的道理就是不要乱使用rm命令,我就是把rm命令改成mv命令。这不,弄好了之后,一直在稳定运行,但是近期我发现,博客访问不了了,查看发现,docker服务在开启后几秒钟后就会关闭,实在是弄不好啊,于是我就给阿里云重新装了系统,想着把之前备份的docker镜像再导入到新系统中,md,悲催,备份的tar包又损换了,我这人生处处是坑啊。 纵使博客虐我千百遍,我待博客如初恋。 再次开始咱们的安装之旅吧。 二、环境 CentOS Linux release 7.4.1708 (Core) 阿里云的服务器,并且咱们要做的就还有开启https的支持 三、安装步骤 1. 安装docker

Cannot start apache automatically with docker

帅比萌擦擦* 提交于 2019-12-11 11:18:25
问题 I made a simple custom docker setup for php development. So far everything works as expected. The only thing that I cannot figure out is why apache2 does not start automatically. Here is my dockerfile: FROM ubuntu:latest RUN apt-get update && apt-get install -y apache2 php libapache2-mod-php php-mcrypt php-mysql php-cli php-curl php-xml php-intl php-mbstring git vim composer curl COPY . /var/www/example COPY vhost.conf /etc/apache2/sites-available/example.conf RUN a2ensite example RUN chown

docker compose logging is not working with syslog option

浪尽此生 提交于 2019-12-11 10:57:25
问题 I have a docker-compose configuration like this: version: '3' services: worker: image: // image logging: driver: syslog options: syslog-address: "udp://XXX.papertrailapp.com:XXXX" tag: "{{.Name}}/{{.ID}}" When I deploy this to digital ocean & ubuntu I can successfully run the docker-compose up command like so: docker-compose -f docker-compose.yml up When that command runs I can see this output worker_2_844fc7675414 | WARNING: no logs are available with the 'syslog' log driver worker_1

How to use Docker with Paket?

一笑奈何 提交于 2019-12-11 10:31:26
问题 There are several projects in my solution (some production and some test ...) and there is a docker image per each project. Each .fsproj file in the solution contains the line: <Import Project="..\.paket\Paket.Restore.targets" /> But docker's build context is limited by the project's folder and I'd rather not deal with that problem. Can use Paket without the need for referring to parent folders? 回答1: I'm not an expert, but I guess you have two options here: You can keep Paket.Restore.targets

How can I set path to load data from CSV file into PostgreSQL database in Docker container?

回眸只為那壹抹淺笑 提交于 2019-12-11 10:16:34
问题 I would like to load data from CSV file into PostgreSQL database in Docker. I run: docker exec -ti my project_db_1 psql -U postgres Then I select my database: \c myDatabase Now I try to load data from myfile.csv which is in the main directory of the Django project into backend_data table: \copy backend_data (t, sth1, sth2) FROM 'myfile.csv' CSV HEADER; However I get error: myfile.csv: No such file or directory It seems to me that I tried every possible path and nothing works. Any ideas how

Spring Boot App container cannot connect to MySQl container

余生颓废 提交于 2019-12-11 10:04:20
问题 I am trying to containerize my Spring Boot app to work with multiple environments (production and dev). In my dev environment, I use docker-compose to start up an instance of MySQL server which my Spring Boot app is able to connect to when it is running outside a container but when my Spring Boot app is running in a container, it is unable to connect to the MySQL server. This is the error I get when I run docker-compose up . app_1 | 19:48:07.708 ERROR -- [ main] o.s.b.web.embedded.tomcat

Docker Compose

蓝咒 提交于 2019-12-11 10:04:18
Compose负责实现对Docker容器集群的快速编排。定位是 定义和运行多个Docker容器的应用,前身是Fig。 Compose允许用户通过单一docker-compose.yml模板文件(YAML格式)来定义一组相关的应用容器为一个项目。通过子命令对项目中的一组容器进行生命周期管理。 Compose中两个重要概念: 服务(service):一个应用的容器,实际上可以包含若干运行相同镜像的容器实例。 项目(project):由一组关联的应用容器组成的一个完整业务单元,在docker-compose.yml文件中定义。 Compose项目由Python编写,实现上调用了Docker服务提供的API来对容器进行管理。因此,只要所操作的平台支持DockerAPI,就可以利用compose进行编排管理。 安装与卸载 Compose支持Linux、macOS、Windows10三大平台。 Compose可以通过Python的包管理工具pip进行安装,也可以直接下载编译好的二进制文件使用,甚至可以直接在Docker容器中运行。 Docker Desktop for Mac/Windows自带docker-compose二进制文件,安装Docker之后可以直接使用。 书上是建议直接下载二进制文件(版本号注意调整成最新)。 curl -L https://github.com/docker

Docker swarm cluster and elasticsearch, using constraints to bind a service to a specific node

≯℡__Kan透↙ 提交于 2019-12-11 09:50:00
问题 i was hoping someone here might be able to give me some input with a problem i'm having. I have a Docker swarm cluster with 3 nodes and want to run the ELK stack but i am not sure how to store my data. version: '3' services: master01: image: elasticsearch:5.2.2 ports: - 9200:9200 - 9300:9300 networks: - es volumes: - /es/data:/usr/share/elasticsearch/data command: > elasticsearch -E network.host=_eth0_ -E node.master=true -E discovery.zen.ping.unicast.hosts=es_master01,es_master02,es_master03

Docker volume, change file permissions/owner

≡放荡痞女 提交于 2019-12-11 09:40:03
问题 I'm running ruby on rails in a docker container. If I generate something like docker-compose run rails rails g controller posts index show , the file owner is root. After that I must always run chown -R . $USER and this is annoying. Does any one know how I can fix this, so that the owner from each generated file is the host user? 回答1: You can run with docker-compose run --user $USER , but that user must already exist in the container, so you'd have to create it in your Dockerfile. 来源: https:/

Docker compose build time args from file

人盡茶涼 提交于 2019-12-11 08:43:49
问题 I'm aware of the variable substitutions available, where I could use a .env at the root of the project and that would be done, but in this case I'm adapting an existing project, where existing .env file locations are expected and I would like to prevent having to have var entries on multiple files! See documentation for more info, and all the code is available as WIP on the docker-support branch of the repo, but I'll succinctly describe the project and issue below: Project structure |- root |