@ -101,7 +101,7 @@ By going to **localhost/your_app** in your browser you should be able to see now
# Testing your website with Docker
# Testing your website with Docker
Since the site on hal.elte.hu will run inside a Docker container, before publishing you should test your work locally. To install Docker visit [this](https://docs.docker.com/get-docker/) link.
Since the site on hal.elte.hu will run inside a Docker container, before publishing you should test your work locally. To install Docker visit [this](https://docs.docker.com/get-docker/) link.
Once Docker is up and running, you should make a new project folder **DO NOT USE /var/www/html/!**, and copy `your_app.conf` and the `your_app folder` from `/var/www/html/` inside. Once you're done adding some other scirpts detailed a little further, the folder struture should look like this:
Once Docker is up and running, you should make a new project folder **DO NOT USE /var/www/html/!**, and copy `your_app.conf` and the `your_app folder` from `/var/www/html/` inside. (You should omit copying the venv.) Once you're done adding some other scirpts detailed a little further, the folder struture should look like this:
> |----/your_app_docker/
> |----/your_app_docker/
> |-----------------your_app.conf
> |-----------------your_app.conf
> |-----------------Dockerfile --> **We’ll make this later**
> |-----------------Dockerfile --> **We’ll make this later**
@ -115,6 +115,75 @@ Once Docker is up and running, you should make a new project folder **DO NOT USE
Make sure that `your_app` is replaced with the name of your folder, and the paths are the same, as in the folder structure above.
#### `start_apache.sh`
```
#!/bin/sh
set -e
. /etc/apache2/envvars
ulimit -n 8192
chown root:www-data /var/lock/apache2
chown -R www-data:www-data /var/www/html
exec /usr/sbin/apache2 -k start -DFOREGROUND
```
#### `locale.gen`
```
hu_HU.UTF-8 UTF-8
```
Add here other languages as needed.
With everything in place go to `/your_app_docker` and run the following commands:
1. Build an image: `docker build --rm -t your_app_img .`
2. Run the container: `docker run -d --name your_app -p 8085:80 your_app_img`
Then you should be able to access your website at **localhost:8085/your_app**. Once you're done you can stop and remove both the container and the image.