问候!对不起,我的英语。 需要你的帮助。专门为Windows 10拆装Docker花费了许多时间(这真是地狱,但是需要Windows)。 我的客户端泊坞窗:最后是Windows桌面,请从站点外下载。
需要用于网络的图像:
-Php 7.2-fpm-alpine
-Nginx:alpine
-Postgres10.1-alpine
-Composer
-Node10.2-alpine
-Git
I downloaded the necessary software, cloned the project, recorded the database, created commands for composer (composer install, update) and node (npm install, update).
所有这些都在Windows10pro-> alpine上。 Nginx + php + composer + nodejs已经可以运行,其余的则不能。
泊坞窗存在问题-git clone(.ssh-key),postgres(db:postgres)os alpine。准确地说,具有git的权利,并且未连接测试库。
错误:
Git:他以不同的方式设置权限-chmod,在ssh上创建docker-entrypoint.sh,卷。通常,没有任何帮助。该项目不会克隆,ssh匹配主机(win10)/泊坞窗(高山)
Postgres: db没有创建默认值,尽管环境拼写正确。我在Dockerfile本身中注册,但未成功。该数据库必须存储在我的容器中并在启动时存储。
Мydocker-composer:
version: '3.7'
services:
nginx:
build: ./docker
restart: always
networks:
- backend
volumes:
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
- ${APP_PATH_HOST}:${APP_PATH_CONTAINER}
- ./logs-nginx:/var/log/nginx
ports:
- 80:80
working_dir: ${APP_PATH_CONTAINER}
links:
- php
php:
build: ./docker/php
restart: always
networks:
- backend
links:
- node
- postgres
volumes:
- ${APP_PATH_HOST}:${APP_PATH_CONTAINER}
- ~/.ssh:/root/.ssh:ro
working_dir: ${APP_PATH_CONTAINER}
postgres:
build: ./docker/postgres
networks:
- backend
restart: always
environment:
- POSTGRES_DB=${DB_NAME}
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- PGDATA=/tmp
ports:
- 5433:5432
volumes:
- ${DB_PATH_HOST}:/var/lib/postgresql/data
- ${DB_PATH_HOST}:/docker-entrypoint-initdb.d/
composer:
image: composer
volumes:
- ${APP_PATH_HOST}:${APP_PATH_CONTAINER}
working_dir: ${APP_PATH_CONTAINER}
command: composer install
node:
build: ./docker/node
user: node
working_dir: ${APP_PATH_CONTAINER}
environment:
- NODE_ENV=production
networks:
- backend
volumes:
- ${APP_PATH_HOST}:/home/node/app
expose:
- "8081"
networks:
frontend:
driver: bridge
backend:
driver: bridge
我的dockerfile php:
FROM php:7.2-fpm-alpine
USER root
#COPY docker-entrypoint.sh /bin/docker-entrypoint.sh
#RUN chmod +x /bin/docker-entrypoint.sh
#ENTRYPOINT ["/bin/docker-entrypoint.sh"]
RUN apk --update add ca-certificates \
&& apk add -U \
# Packages ./. git \
openssh \ # Clean up
&& rm -rf /var/cache/apk/*
VOLUME /var/www VOLUME /root/.ssh
# Clone a repository (my website in this case) git clone git@github.com:user/rep
Dockerfile postgres:
FROM postgres:10.1-alpine
VOLUME /var/lib/postgresql/data
EXPOSE 5432
帮助,如果有人遇到此问题并在Windows 10专业版上具有docker经验。