Created
April 11, 2017 15:22
-
-
Save cornernote/53af7df7ff6f28b3e125141a10914229 to your computer and use it in GitHub Desktop.
test docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
php: | |
build: | |
dockerfile: Dockerfile | |
context: . | |
depends_on: | |
- db | |
- memcached | |
environment: | |
- DB_ENV_MYSQL_ROOT_PASSWORD=pass | |
- GITHUB_API_TOKEN=${GITHUB_API_TOKEN} | |
networks: | |
default: | |
aliases: | |
- phpfpm | |
nginx: | |
image: phundament/nginx-one:1.9 | |
ports: | |
- 29680:80 | |
depends_on: | |
- php | |
db: | |
command: --character-set-server=utf8 --collation-server=utf8_general_ci | |
image: percona:5.7 | |
environment: | |
MYSQL_USER: jobflw4 | |
MYSQL_DATABASE: jobflw4 | |
MYSQL_PASSWORD: pass | |
MYSQL_ROOT_PASSWORD: pass | |
ports: | |
- '3306' | |
memcached: | |
image: memcached |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM phundament/php-one:5.6-fpm-5.1.1 | |
# Server packages | |
RUN apt-get update -y | |
RUN apt-get install php5-imagick -y | |
RUN rm -rf /var/lib/apt/lists/* | |
# PHP packages | |
RUN yes | pecl install memcache | |
RUN docker-php-ext-enable memcache | |
RUN yes | pecl install xdebug | |
RUN docker-php-ext-enable xdebug | |
# Application packages | |
WORKDIR /app | |
COPY composer.* /app/ | |
RUN composer install --prefer-dist --optimize-autoloader && \ | |
composer clear-cache | |
# Server setup | |
COPY build/files / | |
# Application setup | |
COPY yii /app/ | |
COPY web /app/web | |
COPY src /app/src | |
COPY build/bin /app/bin | |
RUN cp src/app.env-dist src/app.env | |
# Server permissions | |
RUN chmod -R ugo+r /root/.composer/vendor | |
RUN chown -R www-data:www-data /root/.composer/vendor | |
# Application permissions | |
RUN mkdir -p runtime web/assets | |
RUN chmod -R 775 runtime web/assets | |
RUN chown -R www-data:www-data runtime web/assets |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment