Skip to content

Instantly share code, notes, and snippets.

View kamiazya's full-sized avatar

Yuki Yamazaki kamiazya

View GitHub Profile
@kamiazya
kamiazya / Dockerfile
Last active February 26, 2020 08:59
php:7.1.2-fpm-alpineにredis拡張をインストールする
FROM php:7.1.2-fpm-alpine
# php-redis
ENV PHPREDIS_VERSION 3.1.2
RUN docker-php-source extract \
&& curl -L -o /tmp/redis.tar.gz https://github.com/phpredis/phpredis/archive/$PHPREDIS_VERSION.tar.gz \
&& tar xfz /tmp/redis.tar.gz \
&& rm -r /tmp/redis.tar.gz \
&& mv phpredis-$PHPREDIS_VERSION /usr/src/php/ext/redis \
@kamiazya
kamiazya / docker-compose.yml
Last active February 26, 2020 08:57
redisとWebUIの最小構成のdocker-compose.yml
version: "3"
services:
# redis
redis:
image: redis:3.2.11-alpine
# redis用のWebUI
# 3000番ポートを開放
commander:
@kamiazya
kamiazya / Dockerfile
Last active February 26, 2020 08:56
CakePHP 2.x系からRedisを利用するためのDockerfileとcore.php
FROM php:7.2.1-fpm-alpine3.7
# Redisとの連携部分の定義
ENV REDIS_HOST redis
ENV REDIS_PORT 6379
# redis拡張をインストール
ENV PHPREDIS_VERSION 3.1.2
@kamiazya
kamiazya / core.php
Created February 15, 2018 08:04
CakePHP 2.x系でデバッグレベルを環境変数で操作する
<?php
/**
* CakePHP Debug Level:
*
* Production Mode:
* 0: No error messages, errors, or warnings shown. Flash messages redirect.
*
* Development Mode:
* 1: Errors and warnings shown, model caches refreshed, flash messages halted.
* 2: As in 1, but also with full debug messages and SQL output.
@kamiazya
kamiazya / README.md
Created February 19, 2018 09:49
Docker on Seleniumでいい感じのUIテスト環境
@kamiazya
kamiazya / docker-compose.yml
Last active February 21, 2018 05:09
docker-composeフォーマットの3.5からnetworkに名前をつけられる
version: '3.5'
services:
app:
image: nginx
container_name: my-app
networks:
- default
ports:
- 8080:80
@kamiazya
kamiazya / Dockerfile
Created March 3, 2018 16:54
AngularのDockerfile
FROM node:8-alpine as builder
COPY package.json package-lock.json ./
RUN npm set progress=false && npm config set depth 0 && npm cache clean --force
## Storing node modules on a separate layer will prevent unnecessary npm installs at each build
RUN npm i && mkdir /ng-app && cp -R ./node_modules ./ng-app
WORKDIR /ng-app
@kamiazya
kamiazya / rx-ws.py
Last active February 26, 2020 08:54
WebSocketとRxPyの連携
import json
import threading
from websocket import create_connection
from rx.subjects import Subject
from rx.concurrency import ThreadPoolScheduler
def observable():
# ThreadPool
pool_scheduler = ThreadPoolScheduler(1)
@kamiazya
kamiazya / Dockerfile
Created March 6, 2018 06:13
PHPでXdebugを使う(未検証)
FROM php:7.1.14-fpm-alpine3.4
# mysql
RUN docker-php-ext-install mysqli pdo_mysql
# xdebug
RUN apk add --no-cache $PHPIZE_DEPS \
&& pecl install xdebug-2.5.0 \
&& docker-php-ext-enable xdebug
@kamiazya
kamiazya / gist:835d2eacabc299425a137cae321bdd75
Created March 7, 2018 02:34
drow.ioをlocalhostで起動する
docker run -it --rm --name="draw" -p 8080:8080 -p 8443:8443 fjudith/draw.io