Commit 13f98b5f authored by Nguyen Hung Manh's avatar Nguyen Hung Manh
Browse files

Initial commit

parents
FROM alpine:3.7
# install deps
RUN apk update && \
apk add curl && \
rm -rf /var/lib/apt/lists/* && \
apk add tar
# make some temporary files
RUN mkdir -p /srv/wordpress
# download from server and rename it
RUN wget "https://github.com/caddyserver/caddy/releases/download/v1.0.3/caddy_v1.0.3_linux_arm7.tar.gz" -O caddy.tar.gz
# untar it and move it to our designated folder
RUN tar -xvf caddy.tar.gz -C /tmp/ && mv /tmp/caddy /usr/local/bin/caddy && \
chmod +x /usr/local/bin/caddy
#rm caddy dl
RUN rm caddy.tar.gz
EXPOSE 80 443
WORKDIR /srv
CMD caddy
CADDYPATH='/srv/caddy_home/'
# set root password for querying inside the container
MYSQL_ROOT_PASSWORD=root-pw
# below values should match wp-config
# this will be your new DB and the credentials you use to initiate your Wordpress
MYSQL_DATABASE=blog
MYSQL_USER=UserX
MYSQL_PASSWORD=123456
# by default tls is enabled and Caddy will automatically get a certificate for you as well as manage
# incoming traffic on port 80 or 443
:80 {
# your root folder from which the webserver will serve content
root www
# compression of your sites
gzip
tls off # comment this if you want to utilize Caddy's automated tls configuration with Let's encrypt
# tls /mnt/cloudflare_certs/example.com.pem /mnt/cloudflare_certs/example.com.key example configuration with cloudflare certificates
# will refer PHP interpretation to a PHP-FPM server, we linked the containers and aliased them as php which we then can refer to instead of the container's IP
fastcgi / php:9000 php
rewrite {
if {path} not_match ^\/wp-admin
to {path} {path}/ /index.php?_url={uri}
}
}
version: '3'
services:
caddy:
image: hunnguye/caddy-alpine-armv7:1.0.3
#build: caddy
volumes:
- "./data/wp:/srv" #location of your Wordpress installation
# - "./data/cloudflare_certs:/mnt/cloudflare_certs" #location of your external certificates
depends_on:
- mariadb
- php
ports:
- "80:80"
- "443:443"
restart: always
env_file:
- "./data/env_variables/caddy_env" # passing env variables to set home folder for caddy
networks:
- wordpress
php:
image: hunnguye/php7.4-rc-alpine3.1-fpm-mysqli-armv7:7.4
#build: php
links:
# make sure you change your wp-config
- mariadb:mariadb
volumes:
- "./data/wp:/srv"
restart: always
networks:
- wordpress
mariadb:
image: yobasystems/alpine-mariadb
volumes:
- "./data/db:/var/lib/mysql" # location where you persist DB files
restart: always
env_file:
- "./data/env_variables/mysql_credentials" # passing env variables to initiate a new DB
networks:
- wordpress
networks:
wordpress:
FROM arm32v7/php:7.4-rc-fpm-alpine
#php7.4-rc-alpine3.1-fpm:latest
RUN docker-php-ext-install mysqli && \
docker-php-ext-install bcmath && \
docker-php-ext-install exif
RUN apk --no-cache add shadow && \
usermod -u 55 xfs && \
groupmod -g 55 xfs && \
usermod -u 33 www-data && \
groupmod -g 33 www-data
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment