Created
December 27, 2016 01:33
-
-
Save acro5piano/c99c562170d93720020c8bf4dfd2ec5a to your computer and use it in GitHub Desktop.
DockerコンテナでGulpを動かす ref: http://qiita.com/acro5piano/items/94d10be1c58be5113407
This file contains hidden or 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
web: | |
build: ./docker/web | |
links: | |
- db | |
volumes: | |
- ./:/app | |
ports: | |
- "8000:8000" | |
db: | |
build: ./docker/db | |
environment: | |
MYSQL_ROOT_PASSWORD: root | |
MYSQL_DATABASE: hoge | |
MYSQL_USER: hoge | |
MYSQL_PASSWORD: hoge | |
nodejs: | |
build: ./docker/nodejs | |
volumes: | |
- ./:/app |
This file contains hidden or 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 node:latest | |
RUN npm install -g gulp | |
WORKDIR /app | |
CMD gulp watch |
This file contains hidden or 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
app | |
|-- index.php | |
|-- gulpfile.js <-- これ | |
|-- docker-compose.yml | |
`-- docker | |
|-- db | |
| |-- Dockerfile | |
| `-- my.cnf | |
|-- nodejs | |
| `-- Dockerfile <-- これ | |
`-- web | |
`-- Dockerfile |
This file contains hidden or 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
docker-compose up -d |
This file contains hidden or 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
docker-compose run nodejs npm install |
This file contains hidden or 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
var gulp = require('gulp'); | |
var $ = require('gulp-load-plugins')(); | |
gulp.task('watch', function() { | |
return gulp.src('./**/*.scss') | |
.pipe($.plumber()) | |
.pipe($.sass()) | |
.pipe($.pleeease({ | |
autoprefixer: { | |
browsers: ['last 2 versions', 'android >= 4', 'ios >= 8'] | |
}, | |
minifier: true, | |
})) | |
.pipe(gulp.dest('public/assets/css')); | |
}); |
This file contains hidden or 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
<html> | |
<head> | |
<link type="text/css" rel="stylesheet" href="/assets/css/style.min.css"> | |
</head> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment