Compare commits
4 Commits
b99086b922
...
a8ac87cc2c
| Author | SHA1 | Date | |
|---|---|---|---|
| a8ac87cc2c | |||
| 0931c0f1bb | |||
| d62c3bb404 | |||
| 2e91e01590 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
**/env.shinc
|
||||
.idea
|
||||
|
||||
@ -1,22 +1,25 @@
|
||||
FROM node:10-slim
|
||||
FROM node:12-slim
|
||||
|
||||
ARG PHP_VERSION
|
||||
ENV PHP_CS_FIXER_IGNORE_ENV=true
|
||||
|
||||
# https support
|
||||
RUN apt-get update && \
|
||||
apt-get install -y apt-transport-https ca-certificates
|
||||
apt-get install -y apt-transport-https ca-certificates curl gnupg2
|
||||
|
||||
# add yarn and php
|
||||
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 && \
|
||||
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/php7.3.list && \
|
||||
echo "deb https://packages.sury.org/php/ stretch main" | tee /etc/apt/sources.list.d/${PHP_VERSION}.list && \
|
||||
apt-get update && \
|
||||
apt-get install -y yarn php7.3-cli && \
|
||||
apt-get install -y yarn ${PHP_VERSION}-cli && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/* /tmp/* /var/tmp/*
|
||||
|
||||
|
||||
# add php 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 && \
|
||||
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 && \
|
||||
chmod a+x /usr/local/bin/php-cs-fixer
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
@ -23,13 +23,15 @@ all : build release
|
||||
|
||||
|
||||
build :
|
||||
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.3" --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 tag $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php7.3 $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)
|
||||
docker tag $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php7.3 $(DOCKER_REGISTRY)/$(APP_NAME):latest
|
||||
docker tag $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php7.4 $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)
|
||||
docker tag $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php7.4 $(DOCKER_REGISTRY)/$(APP_NAME):latest
|
||||
|
||||
release : build
|
||||
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)
|
||||
docker push $(DOCKER_REGISTRY)/$(APP_NAME):latest
|
||||
|
||||
16
common.shinc
16
common.shinc
@ -117,3 +117,19 @@ help() {
|
||||
|
||||
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
Executable file
55
fathom/run
Executable file
@ -0,0 +1,55 @@
|
||||
#!/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