Local server fixes, allow custom base image

This commit is contained in:
Juan Ferrer 2022-10-10 10:58:53 +02:00
parent 74561dbd6b
commit ebee84a003
9 changed files with 30 additions and 34 deletions

View File

@ -73,23 +73,22 @@ class Run {
// Build base server image
await docker.build(__dirname, {
tag: 'myvc/server-base',
file: path.join(serverDir, 'Dockerfile')
}, opts.debug);
// Build server image
let serverDockerfile = path.join(dumpDir, 'Dockerfile');
if (!await fs.pathExists(serverDockerfile))
serverDockerfile = path.join(serverDir, 'Dockerfile.server');
await docker.build(__dirname, {
tag: 'myvc/server',
tag: 'myvc/server-base',
file: serverDockerfile
}, opts.debug);
// Build myvc server image
await docker.build(__dirname, {
tag: 'myvc/server',
file: path.join(serverDir, 'Dockerfile')
}, opts.debug);
// Build dump image
const today = new Date();

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "myvc",
"version": "1.4.15",
"version": "1.4.16",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "myvc",
"version": "1.4.15",
"version": "1.4.16",
"license": "GPL-3.0",
"dependencies": {
"@sqltools/formatter": "^1.2.3",

View File

@ -1,6 +1,6 @@
{
"name": "myvc",
"version": "1.4.15",
"version": "1.4.16",
"author": "Verdnatura Levante SL",
"description": "MySQL Version Control",
"license": "GPL-3.0",

View File

@ -1,5 +1,6 @@
FROM mariadb:10.7.3
FROM myvc/server-base
USER root
ENV MYSQL_ROOT_PASSWORD root
ARG DEBIAN_FRONTEND=noninteractive
@ -38,12 +39,13 @@ WORKDIR /workspace
COPY server/docker.cnf /etc/mysql/conf.d/
COPY \
server/docker-init.sh \
server/docker-temp-start.sh \
server/docker-temp-stop.sh \
server/docker-push.sh \
server/docker-dump.sh \
server/docker-start.sh \
/usr/local/bin/
USER mysql
ENTRYPOINT ["docker-start.sh"]
CMD ["mysqld"]

View File

@ -10,11 +10,7 @@ COPY \
COPY myvc.config.yml \
./
RUN gosu mysql docker-init.sh \
&& docker-dump.sh dump/beforeDump \
&& docker-dump.sh dump/.dump \
&& docker-dump.sh dump/afterDump \
&& gosu mysql docker-temp-stop.sh
RUN gosu mysql docker-init.sh
COPY routines routines
COPY versions versions
@ -24,10 +20,7 @@ COPY \
dump/
ARG STAMP=unknown
RUN gosu mysql docker-temp-start.sh \
&& myvc push --socket --commit \
&& docker-dump.sh dump/fixtures \
&& gosu mysql docker-temp-stop.sh
RUN gosu mysql docker-push.sh
RUN echo "[LOG] Import finished." \
&& rm -rf /workspace

View File

@ -1,3 +1 @@
FROM myvc/server-base
USER mysql
FROM mysql:5.6

View File

@ -12,3 +12,9 @@ docker_init_database_dir "$CMD"
docker_temp_server_start "$CMD"
docker_setup_db
docker_process_init_files /docker-entrypoint-initdb.d/*
docker-dump.sh dump/beforeDump
docker-dump.sh dump/.dump
docker-dump.sh dump/afterDump
docker_temp_server_stop

View File

@ -5,3 +5,8 @@ CMD=mysqld
docker_setup_env "$CMD"
docker_temp_server_start "$CMD"
myvc push --socket --commit
docker-dump.sh dump/fixtures
docker_temp_server_stop

View File

@ -1,7 +0,0 @@
#!/bin/bash
. /usr/local/bin/docker-entrypoint.sh
CMD=mysqld
docker_setup_env "$CMD"
docker_temp_server_stop