forked from opencart/opencart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
67 lines (49 loc) · 1.92 KB
/
Dockerfile
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
FROM php:8.2.11-apache
ARG DOWNLOAD_URL
ARG FOLDER
ENV DIR_OPENCART='/var/www/html/'
ENV DIR_STORAGE='/storage/'
ENV DIR_CACHE=${DIR_STORAGE}'cache/'
ENV DIR_DOWNLOAD=${DIR_STORAGE}'download/'
ENV DIR_LOGS=${DIR_STORAGE}'logs/'
ENV DIR_SESSION=${DIR_STORAGE}'session/'
ENV DIR_UPLOAD=${DIR_STORAGE}'upload/'
ENV DIR_IMAGE=${DIR_OPENCART}'image/'
RUN apt-get clean && apt-get update && apt-get install unzip
RUN apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libzip-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg\
&& docker-php-ext-install -j$(nproc) gd \
&& docker-php-ext-install zip && && docker-php-ext-enable zip\
&& docker-php-ext-enable mysqli
RUN apt-get install -y vim
RUN mkdir /storage && mkdir /opencart
RUN if [ -z "$DOWNLOAD_URL" ]; then \
curl -Lo /tmp/opencart.zip $(sh -c 'curl -s https://api.github.com/repos/opencart/opencart/releases/latest | grep "browser_download_url" | cut -d : -f 2,3 | tr -d \"'); \
else \
curl -Lo /tmp/opencart.zip ${DOWNLOAD_URL}; \
fi
RUN unzip /tmp/opencart.zip -d /tmp/opencart;
RUN mv /tmp/opencart/$(if [ -n "$FOLDER" ]; then echo $FOLDER; else unzip -l /tmp/opencart.zip | awk '{print $4}' | grep -E 'opencart-[a-z0-9.]+/upload/$'; fi)* ${DIR_OPENCART};
RUN rm -rf /tmp/opencart.zip && rm -rf /tmp/opencart && rm -rf ${DIR_OPENCART}install;
RUN mv ${DIR_OPENCART}system/storage/* /storage
COPY configs ${DIR_OPENCART}
COPY php.ini ${PHP_INI_DIR}
RUN a2enmod rewrite
RUN chown -R www-data:www-data ${DIR_STORAGE}
RUN chmod -R 555 ${DIR_OPENCART}
RUN chmod -R 666 ${DIR_STORAGE}
RUN chmod 555 ${DIR_STORAGE}
RUN chmod -R 555 ${DIR_STORAGE}vendor
RUN chmod 755 ${DIR_LOGS}
RUN chmod -R 644 ${DIR_LOGS}*
RUN chown -R www-data:www-data ${DIR_IMAGE}
RUN chmod -R 744 ${DIR_IMAGE}
RUN chmod -R 755 ${DIR_CACHE}
RUN chmod -R 666 ${DIR_DOWNLOAD}
RUN chmod -R 666 ${DIR_SESSION}
RUN chmod -R 666 ${DIR_UPLOAD}
CMD ["apache2-foreground"]