diff --git a/src/app/DevopsCourse2024 b/src/app/DevopsCourse2024 new file mode 160000 index 0000000..b2dbd00 --- /dev/null +++ b/src/app/DevopsCourse2024 @@ -0,0 +1 @@ +Subproject commit b2dbd0047f80f6445f522a09e13eecb0d14f4b81 diff --git a/src/app/docker-compose.yaml b/src/app/docker-compose.yaml new file mode 100644 index 0000000..1f40a1a --- /dev/null +++ b/src/app/docker-compose.yaml @@ -0,0 +1,52 @@ +version: '2' + +# Note: use the database service name `db` in the Host IP Address field ... +# Or, `docker container inspect {postgrescontainerid}` to obtain the IP Address needed for completing the Drupal setup screen. + +services: + # Postgres + db: + image: postgres:9.6.5-alpine + restart: always + networks: + drupal: + ipv4_address: 192.168.92.43 + environment: + POSTGRES_DB: drupaldb + POSTGRES_USER: drupaluser + POSTGRES_PASSWORD: drupalpassword + volumes: + - db_data:/var/lib/postgresql/data + ports: + - 5432:5432 + + # Drupal + cms: + image: drupal:8.3.7-apache + restart: always + networks: + drupal: + ipv4_address: 192.168.92.21 + ports: + - 8080:80 + volumes: + - cms_modules:/var/www/html/modules + - cms_profiles:/var/www/html/profiles + - cms_themes:/var/www/html/themes + - cms_sites:/var/www/html/sites + depends_on: + - db +networks: + drupal: + ipam: + driver: default + config: + - subnet: "192.168.92.0/24" + +# Volumes +volumes: + db_data: + cms_modules: + cms_profiles: + cms_themes: + cms_sites: diff --git a/src/app/dockerfile b/src/app/dockerfile new file mode 100644 index 0000000..46990cf --- /dev/null +++ b/src/app/dockerfile @@ -0,0 +1,15 @@ +FROM python:3.8.2 +ENV FLASK_APP=flaskr + +ENV FLASK_ENV=development +WORKDIR /usr/src/app +COPY ./DevopsCourse2024 . +RUN pip install --upgrade pip + +RUN pip install --editable . +RUN flask init-db +COPY . . + + +EXPOSE 5000 +CMD ["flask", "run", "--host=0.0.0.0"]