Created
February 21, 2022 21:15
-
-
Save phptek/52d443febeaa58c98bcc9e1a32984d97 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine:3.14 | |
MAINTAINER AKQA 2022 <Wel.Tech@akqa.com> | |
ENV DOCROOT="/var/www/html/" | |
WORKDIR $DOCROOT | |
RUN apk update && apk upgrade | |
COPY .aws/foo-cron/hourly/* /etc/periodic/hourly/ | |
RUN chmod +x /etc/periodic/hourly/* | |
COPY ./docker-entrypoint.sh / | |
RUN chmod a+x /docker-entrypoint.sh | |
ENTRYPOINT ["/docker-entrypoint.sh"] | |
EXPOSE 80 443 | |
Contents of docker-entrypoint | |
#!/bin/sh -e | |
# | |
# Called as the ENTRYPOINT in the Dockerfile for foo-www and foo-cron services. | |
# It allows a single ENTRYPOINT to wrap itself around >1 executable call | |
CMD="$1" | |
case $CMD in | |
php) | |
# Taken from the applicable Dockerfile found on GH | |
# https://github.com/docker-library/php/tree/33b1561787600482eb9aa024ad191ecb3d21bf65/7.3/alpine3.11/fpm | |
php-fpm | |
;; | |
cron) | |
crond -f | |
;; | |
*) | |
exec "$@" | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment