Skip to content

Instantly share code, notes, and snippets.

@hilmiwicak
Last active August 31, 2022 18:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hilmiwicak/ca661e4a10eb22535ea1266110c31f5a to your computer and use it in GitHub Desktop.
Save hilmiwicak/ca661e4a10eb22535ea1266110c31f5a to your computer and use it in GitHub Desktop.
docker-compose for achecker

First, you need to clone new repository for AChecker here

And then run these commands from inside the cloned repo

mkdir -p docker/db_data
cp install/db/achecker_schema.sql docker/db_data/achecker_schema.sql
cp install/db/language_text.sql docker/db/language_text.sql
cd docker

Add these snippet at line 2 of docker/db_data/achecker_schema.sql

DROP TABLE IF EXISTS `language_text`

Put these files (except README file) below inside the docker folder.

To run the docker compose you can use these snippet: docker compose -f docker/docker-compose.yml -p cg-a11y-achecker up --build

To see the site, open localhost:8002/achecker and to connect with the database when you first time installing, use host db and port 3306

version: '3.4'
services:
db:
image: mysql:5.7
command: >
--character-set-server=utf8mb4
--collation-server=utf8mb4_unicode_ci
volumes:
- ./db_data:/docker-entrypoint-initdb.d
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_USER: achecker
MYSQL_PASSWORD: password
MYSQL_DATABASE: achecker
ports:
- '3308:3306'
networks:
- achecker_network
achecker:
build:
context: ..
dockerfile: ./docker/Dockerfile
depends_on:
- db
ports:
- '8002:80'
networks:
- achecker_network
networks:
achecker_network:
driver: bridge
volumes:
achecker_network:
driver: local
FROM php:7.2-apache
RUN mkdir -p /var/www/html/achecker
WORKDIR /var/www/html/achecker
COPY .. .
COPY . ./docker
RUN apt-get update -y && apt-get install -y libpng-dev zlib1g-dev unzip
RUN docker-php-ext-install mysqli zip
RUN docker-php-ext-enable mysqli zip
RUN chmod +x ./docker/install-composer.sh
RUN ./docker/install-composer.sh
RUN mv composer.phar /usr/local/bin/composer
ENV COMPOSER_ALLOW_SUPERUSER=1
RUN composer install
RUN mkdir temp
RUN chmod -R a+w temp
RUN touch include/config.inc.php
RUN chmod a+rw include/config.inc.php
EXPOSE 8002
CMD ["/usr/sbin/apache2ctl", "-DFOREGROUND"]
#!/bin/sh
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
then
>&2 echo 'ERROR: Invalid installer checksum'
rm composer-setup.php
exit 1
fi
php composer-setup.php
RESULT=$?
rm composer-setup.php
exit $RESULT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment