docker pull php:8.3.6-apache
Services are defined in docker-compose.yaml file. Values for environment variables are automatically loaded from .env file.
version: '3.8'
services:
client:
image: nswi153/frontend
ports:
- 8090:80
environment:
SERVER_URL: 'https://webik.ms.mff.cuni.cz/~skoda/2023-24/api/'
./practical-07/
Copy practical-02/cms and practical-03/vite from previous practicals to practical-07/cms and ./vite.
Create a Dockerfile for a container hosting the web application cms. Name the image nswi153/backend. Update the source code of the application so that:
Use php:8.3.6-apache as a base image.
This is a list of steps that you need to carry out to create functional Docker image for the assignment.
sed -i 's/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf
a2enmod rewrite
apt-get update
apt-get -y --no-install-recommends install unzip libpq-dev
docker-php-ext-install pgsql
./practical-07/
Create docker-compose.yaml file hosting:
./practical-07/postgres
Create Dockerfile with postgres:16.2. Automatically populate the database nswi153 with articles and authors.
Once ready utilize the image in the docker-compose file as the database. You may need to modify other files in practical-07 directory to make it work.
You must implement and submit the assignments before 10.5.2024 23:59 UTC.
Content beyond this slide is not mandatory part of the seminar. Yet it may help you with better use and understanding of Docker.
We can employ tools like Watchtower to automatically update the containers.