File README.md changed (mode: 100644) (index 97b1830..3f3eb56) |
... |
... |
build images from the docker folder and map the source of the application to the |
22 |
22 |
### On Windows |
### On Windows |
23 |
23 |
|
|
24 |
24 |
- follow the port forwarding after image is run |
- follow the port forwarding after image is run |
|
25 |
|
|
|
26 |
|
## Run images manually |
|
27 |
|
|
|
28 |
|
### On GNU/Linux and Mac |
|
29 |
|
|
|
30 |
|
If you do not follow build till the end you can ./run and follow the steps |
|
31 |
|
|
|
32 |
|
### On Windows |
|
33 |
|
|
|
34 |
|
Run manually mysql image and app/server image you build in the previous step |
|
35 |
|
|
|
36 |
|
## Starting containers |
|
37 |
|
|
|
38 |
|
- docker ps -a |
|
39 |
|
- start mysql-server |
|
40 |
|
- start dev-server |
|
41 |
|
|
|
42 |
|
## Installing db |
|
43 |
|
|
|
44 |
|
It shall be automatic on dev-server start - it takes time for the first run, so be patient |
|
45 |
|
|
|
46 |
|
If it does not run automatically by some reason in dev-server in /nasa there shall be a ./nasa-start |
|
47 |
|
If errors occured they shall be in /nasa/nasa.initialization.log |
|
48 |
|
While waiting you can tail -f /nasa/nasa.initialization.log |
File docker/application/Dockerfile changed (mode: 100644) (index 45a0dff..547c4df) |
... |
... |
RUN \ |
36 |
36 |
curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony && \ |
curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony && \ |
37 |
37 |
chmod a+x /usr/local/bin/symfony |
chmod a+x /usr/local/bin/symfony |
38 |
38 |
|
|
39 |
|
# Update composer |
|
40 |
|
RUN \ |
|
41 |
|
cd /var/www/html/nasa && \ |
|
42 |
|
composer update |
|
43 |
|
|
|
44 |
|
# Create DB and run all migrations |
|
45 |
|
RUN \ |
|
46 |
|
cd /var/www/html/nasa && \ |
|
47 |
|
bin/console doctrine:database:create && \ |
|
48 |
|
bin/console doctrine:migrations:migrate -n |
|
49 |
|
|
|
50 |
39 |
# Define mountable directories. |
# Define mountable directories. |
51 |
40 |
VOLUME ["/etc/nginx/sites-enabled", "/etc/nginx/certs", "/etc/nginx/conf.d", "/var/log/nginx"] |
VOLUME ["/etc/nginx/sites-enabled", "/etc/nginx/certs", "/etc/nginx/conf.d", "/var/log/nginx"] |
52 |
41 |
|
|
53 |
42 |
RUN \ |
RUN \ |
54 |
43 |
rm /var/www/html/* |
rm /var/www/html/* |
55 |
44 |
|
|
|
45 |
|
COPY nasa.start /nasa/nasa.start |
|
46 |
|
|
56 |
47 |
# Define working directory. |
# Define working directory. |
57 |
48 |
WORKDIR /var/www/html |
WORKDIR /var/www/html |
58 |
49 |
|
|
59 |
50 |
# Define default command. |
# Define default command. |
60 |
|
CMD \ |
|
61 |
|
/etc/init.d/nginx start & \ |
|
62 |
|
/etc/init.d/php7.1-fpm start & \ |
|
63 |
|
tail -f /var/log/dmesg |
|
|
51 |
|
CMD /nasa/nasa.start |
64 |
52 |
|
|
65 |
53 |
# Expose ports. |
# Expose ports. |
66 |
54 |
EXPOSE 80 |
EXPOSE 80 |
File run changed (mode: 100755) (index ec51dcf..f453bc5) |
... |
... |
echo # (optional) move to a new line |
5 |
5 |
if [[ $REPLY =~ ^[Yy]$ ]]; then |
if [[ $REPLY =~ ^[Yy]$ ]]; then |
6 |
6 |
echo # (optional) move to a new line |
echo # (optional) move to a new line |
7 |
7 |
docker network create --driver bridge isolated |
docker network create --driver bridge isolated |
|
8 |
|
printf "\n\nisolated network created\n\n" |
8 |
9 |
else |
else |
9 |
|
printf "not creating isolated network\n" |
|
|
10 |
|
printf "not creating isolated network\n\n" |
10 |
11 |
fi |
fi |
11 |
12 |
|
|
12 |
13 |
read -p "Do you want to run mongodb-server y/N? " -n 1 -r |
read -p "Do you want to run mongodb-server y/N? " -n 1 -r |
|
... |
... |
echo # (optional) move to a new line |
14 |
15 |
if [[ $REPLY =~ ^[Yy]$ ]]; then |
if [[ $REPLY =~ ^[Yy]$ ]]; then |
15 |
16 |
echo # (optional) move to a new line |
echo # (optional) move to a new line |
16 |
17 |
docker run --name mongodb-server -p 27017:27017 --network isolated -d mongo |
docker run --name mongodb-server -p 27017:27017 --network isolated -d mongo |
|
18 |
|
printf "\n\nmongodb-server runned\n\n" |
17 |
19 |
else |
else |
18 |
|
printf "not running mongodb\n" |
|
|
20 |
|
printf "not running mongodb\n\n" |
19 |
21 |
fi |
fi |
20 |
22 |
|
|
21 |
23 |
read -p "Do you want to run mysql-server y/N? " -n 1 -r |
read -p "Do you want to run mysql-server y/N? " -n 1 -r |
|
... |
... |
echo # (optional) move to a new line |
23 |
25 |
if [[ $REPLY =~ ^[Yy]$ ]]; then |
if [[ $REPLY =~ ^[Yy]$ ]]; then |
24 |
26 |
echo # (optional) move to a new line |
echo # (optional) move to a new line |
25 |
27 |
docker run --name mysql-server -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root --network isolated -d mysql |
docker run --name mysql-server -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root --network isolated -d mysql |
|
28 |
|
printf "\n\nmysql-server runned\n\n" |
26 |
29 |
else |
else |
27 |
|
printf "not running mysql\n" |
|
|
30 |
|
printf "not running mysql\n\n" |
28 |
31 |
fi |
fi |
29 |
32 |
|
|
30 |
33 |
if [ -n "$1" ]; then |
if [ -n "$1" ]; then |
|
... |
... |
if [[ $REPLY =~ ^[Yy]$ ]]; then |
50 |
53 |
docker run --name dev-server -p 8080:80 -v $(pwd)/src:/var/www/html --network isolated -d app/server:$VERSION |
docker run --name dev-server -p 8080:80 -v $(pwd)/src:/var/www/html --network isolated -d app/server:$VERSION |
51 |
54 |
docker exec -it dev-server bash |
docker exec -it dev-server bash |
52 |
55 |
else |
else |
53 |
|
printf "not running app/server:$VERSION\n" |
|
|
56 |
|
printf "not running app/server:$VERSION\n\n" |
54 |
57 |
fi |
fi |