Compare commits
1 Commits
master
..
527da6d5a7
| Author | SHA1 | Date | |
|---|---|---|---|
| 527da6d5a7 |
@@ -1,2 +1 @@
|
|||||||
**/env.shinc
|
**/env.shinc
|
||||||
.idea
|
|
||||||
|
|||||||
@@ -14,7 +14,4 @@ RUN apk add --no-cache \
|
|||||||
|
|
||||||
COPY ["conf.d/", "/usr/local/etc/php/conf.d"]
|
COPY ["conf.d/", "/usr/local/etc/php/conf.d"]
|
||||||
|
|
||||||
ENV ADMINER_PLUGINS="dump-date dump-json dump-php dump-zip edit-calendar edit-textarea"
|
|
||||||
ENV ADMINER_DESIGN="hever"
|
|
||||||
|
|
||||||
USER adminer
|
USER adminer
|
||||||
|
|||||||
+2
-2
@@ -5,7 +5,7 @@ APP_NAME := adminer
|
|||||||
|
|
||||||
IMAGE_NAME := adminer
|
IMAGE_NAME := adminer
|
||||||
|
|
||||||
VERSION := 4.8.0
|
VERSION := 4.7.7
|
||||||
|
|
||||||
all: build release
|
all: build release
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
@@ -19,8 +19,8 @@ release/%:
|
|||||||
docker tag $(DOCKER_REGISTRY)/$(APP_NAME):$* $(DOCKER_PUBLIC_REGISTRY)/$(APP_NAME):$*
|
docker tag $(DOCKER_REGISTRY)/$(APP_NAME):$* $(DOCKER_PUBLIC_REGISTRY)/$(APP_NAME):$*
|
||||||
docker tag $(DOCKER_REGISTRY)/$(APP_NAME):$* $(DOCKER_MY_REGISTRY)/$(APP_NAME):$*
|
docker tag $(DOCKER_REGISTRY)/$(APP_NAME):$* $(DOCKER_MY_REGISTRY)/$(APP_NAME):$*
|
||||||
docker push $(DOCKER_REGISTRY)/$(APP_NAME):$*
|
docker push $(DOCKER_REGISTRY)/$(APP_NAME):$*
|
||||||
docker push $(DOCKER_MY_REGISTRY)/$(APP_NAME):$*
|
|
||||||
docker push $(DOCKER_PUBLIC_REGISTRY)/$(APP_NAME):$*
|
docker push $(DOCKER_PUBLIC_REGISTRY)/$(APP_NAME):$*
|
||||||
|
docker push $(DOCKER_MY_REGISTRY)/$(APP_NAME):$*
|
||||||
|
|
||||||
|
|
||||||
build: version/$(VERSION)
|
build: version/$(VERSION)
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
SCRIPT_PATH=$( cd "$(dirname "$0")" ; pwd -P )
|
SCRIPT_PATH=$( cd "$(dirname "$0")" ; pwd -P )
|
||||||
|
|
||||||
IMAGE_NAME="yoursystemcz/adminer"
|
IMAGE_NAME="yoursystemcz/adminer"
|
||||||
IMAGE_VERSION="4.8.0"
|
IMAGE_VERSION="4.7.7"
|
||||||
|
|
||||||
SERVICE_NAME=adminer
|
SERVICE_NAME=adminer
|
||||||
|
|
||||||
|
|||||||
@@ -1,25 +1,22 @@
|
|||||||
FROM node:12-slim
|
FROM node:10-slim
|
||||||
|
|
||||||
ARG PHP_VERSION
|
|
||||||
ENV PHP_CS_FIXER_IGNORE_ENV=true
|
|
||||||
|
|
||||||
# https support
|
# https support
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y apt-transport-https ca-certificates curl gnupg2
|
apt-get install -y apt-transport-https ca-certificates
|
||||||
|
|
||||||
# add yarn and php
|
# add yarn and php
|
||||||
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
|
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
|
||||||
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
|
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
|
||||||
curl -sS https://packages.sury.org/php/apt.gpg | apt-key add - && \
|
curl -sS https://packages.sury.org/php/apt.gpg | apt-key add - && \
|
||||||
echo "deb https://packages.sury.org/php/ stretch main" | tee /etc/apt/sources.list.d/${PHP_VERSION}.list && \
|
echo "deb https://packages.sury.org/php/ stretch main" | tee /etc/apt/sources.list.d/php7.3.list && \
|
||||||
apt-get update && \
|
apt-get update && \
|
||||||
apt-get install -y yarn ${PHP_VERSION}-cli && \
|
apt-get install -y yarn php7.3-cli && \
|
||||||
apt-get clean && \
|
apt-get clean && \
|
||||||
rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/* /tmp/* /var/tmp/*
|
rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/* /tmp/* /var/tmp/*
|
||||||
|
|
||||||
|
|
||||||
# add php fixer
|
# add php fixer
|
||||||
RUN curl -L https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.16.3/php-cs-fixer.phar -o /usr/local/bin/php-cs-fixer && \
|
RUN curl -L https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.14.0/php-cs-fixer.phar -o /usr/local/bin/php-cs-fixer && \
|
||||||
chmod a+x /usr/local/bin/php-cs-fixer
|
chmod a+x /usr/local/bin/php-cs-fixer
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|||||||
@@ -23,15 +23,13 @@ all : build release
|
|||||||
|
|
||||||
|
|
||||||
build :
|
build :
|
||||||
docker build --build-arg VERSION=$(VERSION) --build-arg PHP_VERSION="php7.3" --build-arg COMMIT_SHA=$(COMMIT) -t $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php7.3 .
|
docker build --build-arg VERSION=$(VERSION) --build-arg COMMIT_SHA=$(COMMIT) -t $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php7.3 .
|
||||||
docker build --build-arg VERSION=$(VERSION) --build-arg PHP_VERSION="php7.4" --build-arg COMMIT_SHA=$(COMMIT) -t $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php7.4 .
|
|
||||||
docker build --build-arg VERSION=$(VERSION) --build-arg COMMIT_SHA=$(COMMIT) -t $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php5.6 .
|
docker build --build-arg VERSION=$(VERSION) --build-arg COMMIT_SHA=$(COMMIT) -t $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php5.6 .
|
||||||
docker tag $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php7.4 $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)
|
docker tag $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php7.3 $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)
|
||||||
docker tag $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php7.4 $(DOCKER_REGISTRY)/$(APP_NAME):latest
|
docker tag $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php7.3 $(DOCKER_REGISTRY)/$(APP_NAME):latest
|
||||||
|
|
||||||
release : build
|
release : build
|
||||||
docker push $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php7.3
|
docker push $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php7.3
|
||||||
docker push $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php7.4
|
|
||||||
docker push $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php5.6
|
docker push $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php5.6
|
||||||
docker push $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)
|
docker push $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)
|
||||||
docker push $(DOCKER_REGISTRY)/$(APP_NAME):latest
|
docker push $(DOCKER_REGISTRY)/$(APP_NAME):latest
|
||||||
|
|||||||
@@ -117,19 +117,3 @@ help() {
|
|||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
realpath $PWD > /dev/null 2>&1
|
|
||||||
if [[ $? -ne 0 ]]; then
|
|
||||||
realpath() {
|
|
||||||
OURPWD=$PWD
|
|
||||||
cd "$(dirname "$1")"
|
|
||||||
LINK=$(readlink "$(basename "$1")")
|
|
||||||
while [ "$LINK" ]; do
|
|
||||||
cd "$(dirname "$LINK")"
|
|
||||||
LINK=$(readlink "$(basename "$1")")
|
|
||||||
done
|
|
||||||
REALPATH="$PWD/$(basename "$1")"
|
|
||||||
cd "$OURPWD"
|
|
||||||
echo "$REALPATH"
|
|
||||||
}
|
|
||||||
fi
|
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ APP_NAME = dev-proxy
|
|||||||
APP_VERSION = 2.0
|
APP_VERSION = 2.0
|
||||||
|
|
||||||
|
|
||||||
all: build tag release
|
all: build release
|
||||||
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
|||||||
+2
-2
@@ -22,7 +22,7 @@ init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
makePrivate() {
|
makePrivate() {
|
||||||
docker pull ${IMAGE_NAME}:${IMAGE_VERSION} || return $?
|
# docker pull ${IMAGE_NAME}:${IMAGE_VERSION} || return $?
|
||||||
|
|
||||||
NETWORKS=(${PROXY_NETWORK})
|
NETWORKS=(${PROXY_NETWORK})
|
||||||
__createNetworks
|
__createNetworks
|
||||||
@@ -65,7 +65,7 @@ makePublic() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
reload() {
|
reload() {
|
||||||
docker exec ${SERVICE_NAME} caddy reload --config /etc/caddy/Caddyfile
|
docker exec ${SERVICE_NAME} pkill -USR1 caddy
|
||||||
}
|
}
|
||||||
|
|
||||||
"$@"
|
"$@"
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
/.dockerignore
|
|
||||||
/Dockerfile
|
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
dockergen: docker-gen -notify-output -config /code/docker-gen/config/docker-gen.cfg -notify caddy reload
|
dockergen: docker-gen -notify-output -config /code/docker-gen/config/docker-gen.cfg
|
||||||
caddy: caddy run --config /etc/caddy/Caddyfile --watch
|
caddy: caddy run --config /etc/caddy/Caddyfile --watch
|
||||||
|
|||||||
@@ -4,4 +4,3 @@ dest = "/etc/caddy/Caddyfile"
|
|||||||
onlyexposed = false
|
onlyexposed = false
|
||||||
watch = true
|
watch = true
|
||||||
wait = "500ms:2s"
|
wait = "500ms:2s"
|
||||||
notifycmd = "caddy reload --config /etc/caddy/Caddyfile"
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
root * /code/errorPages/siteNotFound
|
root * /code/errorPages/siteNotFound
|
||||||
file_server
|
file_server
|
||||||
header Cache-Control "no-cache, max-age=0"
|
header Cache-Control "no-cache, max-age=0"
|
||||||
try_files {path} /index.html
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{{ if $hosts }}
|
{{ if $hosts }}
|
||||||
|
|||||||
-55
@@ -1,55 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
SCRIPT_PATH=$( cd "$(dirname "$0")" ; pwd -P )
|
|
||||||
|
|
||||||
IMAGE_NAME="usefathom/fathom"
|
|
||||||
IMAGE_VERSION="latest"
|
|
||||||
|
|
||||||
SERVICE_NAME=fathom
|
|
||||||
|
|
||||||
|
|
||||||
source ${SCRIPT_PATH}/../common.shinc
|
|
||||||
|
|
||||||
#
|
|
||||||
# Project specific variables
|
|
||||||
#
|
|
||||||
|
|
||||||
DOMAIN_NAME="fathom.loc"
|
|
||||||
|
|
||||||
source ${SCRIPT_PATH}/env.shinc 2> /dev/null
|
|
||||||
|
|
||||||
|
|
||||||
init() {
|
|
||||||
__init
|
|
||||||
|
|
||||||
NETWORKS=(${PROXY_NETWORK} ${DB_NETWORK})
|
|
||||||
__createNetworks
|
|
||||||
|
|
||||||
docker create \
|
|
||||||
--name ${SERVICE_NAME} \
|
|
||||||
-e VIRTUAL_HOST=${DOMAIN_NAME} \
|
|
||||||
-e VIRTUAL_PORT=8080 \
|
|
||||||
-e FATHOM_DATABASE_DRIVER="postgres" \
|
|
||||||
-e FATHOM_DATABASE_NAME="fathom" \
|
|
||||||
-e FATHOM_DATABASE_USER="root" \
|
|
||||||
-e FATHOM_DATABASE_PASSWORD="megaheslo" \
|
|
||||||
-e FATHOM_DATABASE_HOST="pgsql-db" \
|
|
||||||
-e FATHOM_DATABASE_SSLMODE="disable" \
|
|
||||||
-e FATHOM_SECRET="abcdefghijqrstuvw34567890" \
|
|
||||||
${IMAGE_NAME}:${IMAGE_VERSION}
|
|
||||||
|
|
||||||
[[ $? -ne 0 ]] && return 1
|
|
||||||
|
|
||||||
docker network connect ${PROXY_NETWORK} ${SERVICE_NAME}
|
|
||||||
[[ $? -ne 0 ]] && return 1
|
|
||||||
|
|
||||||
|
|
||||||
docker network connect ${DB_NETWORK} ${SERVICE_NAME}
|
|
||||||
[[ $? -ne 0 ]] && return 1
|
|
||||||
|
|
||||||
__ask_to_start
|
|
||||||
}
|
|
||||||
|
|
||||||
"$@"
|
|
||||||
|
|
||||||
exit $?
|
|
||||||
@@ -78,8 +78,6 @@ import() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
__msg "Importing, please wait..."
|
|
||||||
|
|
||||||
local path=$(realpath "${filename}")
|
local path=$(realpath "${filename}")
|
||||||
local name=$(basename "${path}")
|
local name=$(basename "${path}")
|
||||||
|
|
||||||
|
|||||||
+9
-52
@@ -59,47 +59,9 @@ init() {
|
|||||||
__ask_to_start
|
__ask_to_start
|
||||||
}
|
}
|
||||||
|
|
||||||
import() {
|
|
||||||
local dbname="$1"
|
|
||||||
shift
|
|
||||||
local filename="$1"
|
|
||||||
shift
|
|
||||||
|
|
||||||
if [[ "${dbname}" == "" ]] || [[ "${filename}" == "" ]]; then
|
|
||||||
__err "You must provide database name and filename of the file you want to import"
|
|
||||||
__msg "E.g. ./run import my-database-name \"\$PWD/my-file.sql\""
|
|
||||||
return 137
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -f "${filename}" ]]; then
|
|
||||||
__err "The filename was not located at ${filename}"
|
|
||||||
return 137
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo -e "${C_WARN}This will import the file located at \"${C_WHITE}${filename}${C_WARN}\" to a database named \"${C_WHITE}${dbname}${C_WARN}\"${C_NONE}"
|
|
||||||
|
|
||||||
echo
|
|
||||||
|
|
||||||
__warn "Do you want to continue? [y/(n)] "
|
|
||||||
|
|
||||||
read CONTINUE
|
|
||||||
|
|
||||||
if [[ "${CONTINUE}" != "y" ]]; then
|
|
||||||
__msg "Quiting..."
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
__msg "Importing, please wait..."
|
|
||||||
|
|
||||||
local path=$(realpath "${filename}")
|
|
||||||
local name=$(basename "${path}")
|
|
||||||
|
|
||||||
docker run --rm -it -v "${path}":"/import/${name}" --net ${DB_NETWORK} ${IMAGE_NAME}:${IMAGE_VERSION} pg_restore --no-owner -Fc --host=${SERVICE_NAME} --password --dbname=${dbname} "/import/${name}"
|
|
||||||
}
|
|
||||||
|
|
||||||
migrate9to10() {
|
migrate9to10() {
|
||||||
local migrationVolume="pgsql-9-10-dump-migration"
|
local migrationVolume="pgsql-9-10-dump-migration"
|
||||||
local migrationPath="/pgsql-data-dump"
|
local migrationpath="/pgsql-data-dump"
|
||||||
stop
|
stop
|
||||||
docker volume create ${migrationVolume}
|
docker volume create ${migrationVolume}
|
||||||
|
|
||||||
@@ -107,20 +69,16 @@ migrate9to10() {
|
|||||||
--name postgres_migration_from_9 \
|
--name postgres_migration_from_9 \
|
||||||
-v ${DB_VOLUME}:/var/lib/postgresql/data \
|
-v ${DB_VOLUME}:/var/lib/postgresql/data \
|
||||||
-v ${PGSQL_DB_BIN}:/usr/lib/postgresql/${IMAGE_VERSION}/bin \
|
-v ${PGSQL_DB_BIN}:/usr/lib/postgresql/${IMAGE_VERSION}/bin \
|
||||||
-v ${migrationVolume}:${migrationPath} \
|
-v ${migrationVolume}:${migrationpath} \
|
||||||
-e POSTGRES_USER=${DB_USER} \
|
-e POSTGRES_USER=${DB_USER} \
|
||||||
-e POSTGRES_PASSWORD=${DB_PASSWORD} \
|
-e POSTGRES_PASSWORD=${DB_PASSWORD} \
|
||||||
mdillon/postgis:9.5
|
mdillon/postgis:9
|
||||||
|
|
||||||
echo "Waiting for postgres to initialize"
|
|
||||||
sleep 10
|
|
||||||
|
|
||||||
docker exec -it \
|
docker exec -it \
|
||||||
postgres_migration_from_9 \
|
postgres_migration_from_9 \
|
||||||
bash -c "pg_dumpall > ${migrationPath}/full.dump"
|
bash -c "pg_dumpall > /migration/full.dump"
|
||||||
|
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
docker stop postgres_migration_from_9
|
|
||||||
__err "Bad thing, don't continue, quitsies, bye"
|
__err "Bad thing, don't continue, quitsies, bye"
|
||||||
exit 137
|
exit 137
|
||||||
fi
|
fi
|
||||||
@@ -134,16 +92,15 @@ migrate9to10() {
|
|||||||
--name postgres_migration_to_10 \
|
--name postgres_migration_to_10 \
|
||||||
-v ${DB_VOLUME}:/var/lib/postgresql/data \
|
-v ${DB_VOLUME}:/var/lib/postgresql/data \
|
||||||
-v ${PGSQL_DB_BIN}:/usr/lib/postgresql/${IMAGE_VERSION}/bin \
|
-v ${PGSQL_DB_BIN}:/usr/lib/postgresql/${IMAGE_VERSION}/bin \
|
||||||
-v ${migrationVolume}:${migrationPath} \
|
-v ${migrationVolume}:${migrationpath} \
|
||||||
-e POSTGRES_USER=${DB_USER} \
|
-e POSTGRES_USER=${DB_USER} \
|
||||||
-e POSTGRES_PASSWORD=${DB_PASSWORD} \
|
-e POSTGRES_PASSWORD=${DB_PASSWORD} \
|
||||||
mdillon/postgis:10
|
mdillon/postgis:10 \
|
||||||
|
psql -d postgres -f ${migrationpath}/full.dump
|
||||||
|
|
||||||
echo "Waiting for postgres to initialize"
|
sudo docker exec -it \
|
||||||
sleep 30
|
|
||||||
docker exec -it \
|
|
||||||
postgres_migration_to_10 \
|
postgres_migration_to_10 \
|
||||||
psql -f ${migrationPath}/full.dump
|
psql -f /migration/full.dump
|
||||||
|
|
||||||
docker stop postgres_migration_to_10
|
docker stop postgres_migration_to_10
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user