Compare commits
No commits in common. "a8ac87cc2cfa73cf353890c6381b7dedd99e8ae1" and "b99086b922c121c89a99540f9c01a4d98db347e3" have entirely different histories.
a8ac87cc2c
...
b99086b922
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1 @@
|
|||||||
**/env.shinc
|
**/env.shinc
|
||||||
.idea
|
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
16
common.shinc
16
common.shinc
@ -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
|
|
||||||
|
|||||||
55
fathom/run
55
fathom/run
@ -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 $?
|
|
||||||
Loading…
Reference in New Issue
Block a user