From 4228f4e93bb5aafc2011e1118720a95cadcf509c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=5BBE=5D=20=EA=B9=80=EC=96=B4=EC=A7=84=20=28Bradley=29?= Date: Thu, 30 Mar 2023 16:34:40 +0900 Subject: [PATCH] =?UTF-8?q?Dockerfile=20=EB=B0=8F=20compose=20=EC=9E=91?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .docker/Dockerfile | 10 ++++++++++ .env.example | 6 ++++++ .gitignore | 1 + docker-compose.yaml | 29 +++++++++++++++++++++++++++++ 4 files changed, 46 insertions(+) create mode 100644 .docker/Dockerfile create mode 100644 .env.example create mode 100644 .gitignore create mode 100644 docker-compose.yaml diff --git a/.docker/Dockerfile b/.docker/Dockerfile new file mode 100644 index 0000000..f3dbccd --- /dev/null +++ b/.docker/Dockerfile @@ -0,0 +1,10 @@ +FROM php:7.4-apache + +# install mysqli and gd +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ +RUN chmod +x /usr/local/bin/install-php-extensions && \ + install-php-extensions gd mysqli + +# install app +COPY ./AvocadoEdition /var/www/html/ +RUN chmod -R 707 /var/www/html/data \ No newline at end of file diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..6a23715 --- /dev/null +++ b/.env.example @@ -0,0 +1,6 @@ +APP_PORT=80 + +MYSQL_ROOT_PASSWORD=avocadoedition +MYSQL_DATABASE=avocadoedition +MYSQL_USER=avocadoedition +MYSQL_PASSWORD=avocadoedition \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2eea525 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..422623d --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,29 @@ +services: + app: + build: + context: . + dockerfile: ./.docker/Dockerfile + container_name: avocado-edition-app + volumes: + - ./AvocadoEdition:/var/www/html + ports: + - ${APP_PORT:-80}:80 + depends_on: + - db + restart: unless-stopped + db: + image: lscr.io/linuxserver/mariadb:latest + container_name: avocado-edition-db + volumes: + - mariadb:/config + environment: + - PUID=1000 + - PGID=1000 + - TZ=Asia/Seoul + - MYSQL_ROOT_PASSWORD=${ROOT_ACCESS_PASSWORD:-avocadoedition} + - MYSQL_DATABASE=${MYSQL_DATABASE:-avocadoedition} + - MYSQL_USER=${MYSQL_USER:-avocadoedition} + - MYSQL_PASSWORD=${DATABASE_PASSWORD:-avocadoedition} + restart: unless-stopped +volumes: + mariadb: \ No newline at end of file