...
 
Commits (2)
FROM ubuntu:16.04
RUN apt-get update -y && \
apt-get install -y nginx net-tools vim mc
apt-get install -y nginx net-tools vim mc php php-mysql curl
ADD nginx.conf /etc/nginx/nginx.conf
ADD vhost.conf /etc/nginx/sites-available/vhost.conf
......
#!/bin/bash
service php7.0-fpm start
exec /usr/sbin/nginx
server {
listen 80;
index index.php index.html;
root /var/www/html/frontend;
index index.html index.php;
location / {
try_files $uri $uri/ /index.html;
}
location /api {
alias /var/www/html/api/public;
root /var/www/html/api/public;
#if (-f $request_filename) {
# break;
#}
#if (-d $request_filename) {
# break;
#}
rewrite ^/api/(.*)$ /$1 break;
try_files $uri $uri/ /index.php?$args;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
sendfile off;
location ~ \.php$ {
set $newurl $request_uri;
if ($newurl ~ ^/api/(.*)$) {
set $newurl $1;
root /var/www/html/api/public;
}
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
location ~ /\.ht {
deny all;
}
}
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:VcgoAmSJtV5gtWqkAQo8D5DtALsDnkCDKkfNEvdpsq4=
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
DB_CONNECTION=mysql
DB_HOST=db
DB_PORT=3306
DB_DATABASE=weatherstation
DB_USERNAME=weatherstation
DB_PASSWORD=qdrabcabc
BROADCAST_DRIVER=log
CACHE_DRIVER=redis
SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUE_DRIVER=sync
REDIS_HOST=redis
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
FROM ubuntu:16.04
RUN apt-get update -y && apt-get upgrade -y && apt-get install -y openssl zip unzip git php curl wget \
RUN apt-get update -y && apt-get upgrade -y && apt-get install -y openssl zip unzip git php php-mysql curl wget net-tools vim mc curl php-mbstring php-xml \
&& rm -rf /var/lib/apt/lists/*
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
WORKDIR /var/www/html/api
ADD install.sh /opt/bin/install.sh
......@@ -10,6 +12,6 @@ RUN chmod u=rwx /opt/bin/install.sh
ENTRYPOINT ["/opt/bin/install.sh"]
VOLUME /var/www/html/api
COPY .env /var/www/html/.env
CMD sleep 10000
\ No newline at end of file
VOLUME /var/www/html/api
\ No newline at end of file
#!/bin/bash
service php7.0-fpm start
mkdir -p /var
mkdir -p /var/www
mkdir -p /var/www/html
mkdir -p /var/www/html/api
cd /var/www/html/api
if [ -d .git ]; then
if ! git diff --quiet remotes/origin/HEAD; then
git pull
fi
#composer update
git checkout -b test origin/develop
git fetch
git pull
rm composer.lock
composer update
else
git clone https://gitlab.kumpacka.eu/kumpacka/weather-station-api.git .
#composer install
git checkout -b test origin/develop
cp ../.env .
rm composer.lock
composer install
fi
tail -f /dev/null
php artisan migrate
chown www-data: storage -R
sleep 10000
\ No newline at end of file
......@@ -12,5 +12,3 @@ RUN chmod u=rwx /opt/bin/install.sh
ENTRYPOINT ["/opt/bin/install.sh"]
VOLUME /var/www/html/frontend
CMD sleep 10000
\ No newline at end of file
#!/bin/bash
mkdir -p /var
mkdir -p /var/www
mkdir -p /var/www/html
mkdir -p /var/www/html/frontend
cd /var/www/html/frontend
......@@ -16,5 +12,4 @@ else
git clone https://gitlab.kumpacka.eu/kumpacka/weather-station-frontend.git .
fi
tail -f /dev/null
\ No newline at end of file
sleep 10000
\ No newline at end of file
/logs
/dbconf
\ No newline at end of file
/dbconf
.idea
\ No newline at end of file
......@@ -9,12 +9,15 @@ services:
container_name: weather-station-db
restart: always
image: mysql
command: mysqld --default-authentication-plugin=mysql_native_password
environment:
- MYSQL_ROOT_PASSWORD=qdrabcabc
- MYSQL_USER=hellsos
- MYSQL_USER=weatherstation
- MYSQL_PASSWORD=qdrabcabc
- MYSQL_DATABASE=meteo
- MYSQL_DATABASE=weatherstation
- TZ=Europe/Prague
ports:
- 3307:3306
networks:
- back-end
......@@ -33,6 +36,9 @@ services:
weather-station-api:
container_name: weather-station-api
restart: always
# TODO WHEN DEVELOP ENVIRONMENT
#volumes:
# - ../weather-station-api/:/var/www/html/api
build:
context: .docker/weather-station-api
networks:
......@@ -68,6 +74,9 @@ services:
volumes_from:
- weather-station-api
- weather-station-frontend
networks:
- front-end
- back-end
ports:
- 8087:80
depends_on:
......
This diff is collapsed.
This diff is collapsed.