summaryrefslogtreecommitdiff
path: root/sandcastle/images/woocommerce/Dockerfile
blob: 0d16df7fd306897cafac19c963dfb2558d55bcaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
FROM debian:bullseye

# This file is in the public domain.

LABEL docker-woocommerce.demo.taler.net="0.0.1-beta"
RUN echo "avoid docker cache..."

EXPOSE 9001

WORKDIR /root/

COPY tags.conf .
COPY entry-point.sh .

# Install dependencies


RUN apt-get update && apt-get install -y \
    software-properties-common \
    ca-certificates \
    lsb-release  \
    apt-transport-https \
    wget \
    curl \
    git \
    unzip \
    gnupg \
    nginx 

RUN sh -c 'echo "deb https://packages.sury.org/php/ bullseye main" > /etc/apt/sources.list.d/php.list' 

RUN wget -qO - https://packages.sury.org/php/apt.gpg | apt-key add - 

RUN apt-get update 

RUN . /root/tags.conf \
 && apt-get install \
      php${PHP_VERSION} \
      php${PHP_VERSION}-common \
      php${PHP_VERSION}-mbstring \
      php${PHP_VERSION}-xmlrpc \ 
      php${PHP_VERSION}-soap \
      php${PHP_VERSION}-gd \
      php${PHP_VERSION}-xml \
      php${PHP_VERSION}-intl \
      php${PHP_VERSION}-mysql \
      php${PHP_VERSION}-cli \
      php${PHP_VERSION}-ldap \
      php${PHP_VERSION}-zip \
      php${PHP_VERSION}-curl\
      php${PHP_VERSION}-zip \
      php${PHP_VERSION}-fpm -y

# Download Wordpress, plugins and theme + extract

RUN . /root/tags.conf \ 
 && mkdir -p /var/www/wordpress/wp-content/plugins \
 && mkdir -p /var/www/wordpress/wp-content/themes \
 && wget https://wordpress.org/wordpress-${WORDPRESS_VERSION}.tar.gz \
 && tar -xzf wordpress-${WORDPRESS_VERSION}.tar.gz -C /var/www/ \
 && wget https://downloads.wordpress.org/plugin/woocommerce.${WOOCOMMERCE_VERSION}.zip \
 && unzip woocommerce.${WOOCOMMERCE_VERSION}.zip -d /var/www/wordpress/wp-content/plugins \
 && wget https://downloads.wordpress.org/theme/ecommerce-star.${WORDPRESS_PARENT_THEME_VERSION}.zip \
 && unzip ecommerce-star.${WORDPRESS_PARENT_THEME_VERSION}.zip -d /var/www/wordpress/wp-content/themes \
 && wget https://downloads.wordpress.org/theme/shop-here.${WORDPRESS_CHILD_THEME_VERSION}.zip \
 && unzip shop-here.${WORDPRESS_CHILD_THEME_VERSION}.zip -d /var/www/wordpress/wp-content/themes \
 && wget https://downloads.wordpress.org/plugin/gnu-taler-payment-for-woocommerce.zip \  
 && unzip gnu-taler-payment-for-woocommerce.zip -d /var/www/wordpress/wp-content/plugins

# Install wp-cli 

RUN wget https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \
     && chmod +x wp-cli.phar \
     && mv wp-cli.phar /usr/local/bin/wp


RUN chown -R www-data:www-data /var/www/wordpress

# Remove downloads from root directory

RUN rm -Rf /root/*.zip

# Copy nginx configuration from host, to container

COPY woocommerce.conf /etc/nginx/sites-available

RUN ln -s /etc/nginx/sites-available/woocommerce.conf /etc/nginx/sites-enabled/woocommerce.conf \
 && rm /etc/nginx/sites-enabled/default


# Execute entrypoint

RUN chmod +x entry-point.sh

ENTRYPOINT /root/entry-point.sh

# Additional steps after entrypoint.

#CMD ["nginx", "-g", "daemon off;"]