docker dbLocal
This commit is contained in:
parent
85ec628ae6
commit
a0955cf50d
23
gulpfile.js
23
gulpfile.js
|
@ -11,6 +11,8 @@ var fs = require('fs');
|
|||
var webpack = require('webpack');
|
||||
var WebpackDevServer = require('webpack-dev-server');
|
||||
|
||||
var exec = require('child_process').exec;
|
||||
|
||||
// Configuration
|
||||
|
||||
var srcDir = './client';
|
||||
|
@ -148,3 +150,24 @@ gulp.task('watch', function() {
|
|||
gulp.watch(routeFiles, ['routes']);
|
||||
gulp.watch(localeFiles, ['locales']);
|
||||
});
|
||||
|
||||
gulp.task('test', ['deleteDockerDb', 'buildDockerDb'], (callback) => {
|
||||
exec('docker run -d --name dbLocal -p 3306:3306 dblocal:latest', (err, stdout, stderr) => {
|
||||
if (err) {
|
||||
throw new Error(err);
|
||||
}
|
||||
callback(err);
|
||||
});
|
||||
});
|
||||
gulp.task('buildDockerDb', (callback) => {
|
||||
exec('docker build -t dblocal:latest ./services/db', (err, stdout, stderr) => {
|
||||
if (err)
|
||||
throw new Error(err);
|
||||
callback(err);
|
||||
});
|
||||
});
|
||||
gulp.task('deleteDockerDb', (callback) => {
|
||||
exec('docker rm -f dbLocal', () => {
|
||||
callback();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
FROM mysql:5.6.37
|
||||
|
||||
MAINTAINER Vicente Falco
|
||||
|
||||
ENV MYSQL_ALLOW_EMPTY_PASSWORD yes
|
||||
|
||||
COPY localDB01Structure.sql /docker-entrypoint-initdb.d
|
||||
COPY localDB02Inserts.sql /docker-entrypoint-initdb.d
|
||||
|
||||
RUN chmod -R 755 /docker-entrypoint-initdb.d
|
||||
|
||||
CMD ["mysqld"]
|
||||
|
||||
EXPOSE 3306
|
Loading…
Reference in New Issue