forked from appwrite/appwrite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
93 lines (79 loc) Β· 2.96 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
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
FROM ubuntu:24.10
LABEL maintainer="team@appwrite.io"
ENV TZ=Asia/Tel_Aviv
ENV _APP_ENV production
ENV _APP_HOME https://appwrite.io
ENV _APP_EDITION community
ENV _APP_OPTIONS_ABUSE enabled
ENV _APP_OPENSSL_KEY_V1 your-secret-key
ENV _APP_REDIS_HOST redis
ENV _APP_REDIS_PORT 6379
ENV _APP_DB_HOST mariadb
ENV _APP_DB_PORT 3306
ENV _APP_DB_USER root
ENV _APP_DB_PASS password
ENV _APP_DB_SCHEMA appwrite
ENV _APP_INFLUXDB_HOST influxdb
ENV _APP_INFLUXDB_PORT 8086
ENV _APP_STATSD_HOST telegraf
ENV _APP_STATSD_PORT 8125
ENV _APP_SMTP_HOST smtp
ENV _APP_SMTP_PORT 25
#ENV _APP_SMTP_SECURE ''
#ENV _APP_SMTP_USERNAME ''
#ENV _APP_SMTP_PASSWORD ''
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN \
apt-get update --fix-missing && \
apt-get install -y software-properties-common && \
LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php && \
apt-get update --fix-missing && \
apt-get install -y htop supervisor openssl wget php7.3 php7.3-fpm php7.3-mysqlnd php7.3-curl php7.3-imagick php7.3-mbstring php7.3-dom php7.3-dev webp && \
# nginx
echo "deb http://nginx.org/packages/mainline/ubuntu/ wily nginx" >> /etc/apt/sources.list.d/nginx.list && \
echo "deb-src http://nginx.org/packages/mainline/ubuntu/ wily nginx" >> /etc/apt/sources.list.d/nginx.list && \
wget -q http://nginx.org/keys/nginx_signing.key && \
apt-key add nginx_signing.key && \
apt-get update --fix-missing && \
apt-get install -y nginx && \
# redis php extension
wget -q https://github.com/phpredis/phpredis/archive/3.1.2.tar.gz && \
tar -xf 3.1.2.tar.gz && \
cd phpredis-3.1.2 && \
phpize7.3 && \
./configure && \
make && make install && \
echo extension=redis.so >> /etc/php/7.3/fpm/conf.d/redis.ini && \
echo extension=redis.so >> /etc/php/7.3/cli/conf.d/redis.ini && \
# cleanup
cd ../ && \
rm -rf phpredis-3.1.2 && \
rm -rf 3.1.2.tar.gz && \
apt-get purge -y --auto-remove php7.3-dev && \
apt-get purge -y --auto-remove software-properties-common && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Set upload limit
RUN echo "upload_max_filesize = 4M" > /etc/php/7.3/fpm/conf.d/appwrite.ini
# nginx conf (with ssl certificates)
COPY ./docker/nginx.conf /etc/nginx/nginx.conf
COPY ./docker/ssl/nginx.crt /etc/nginx/ssl/nginx.crt
COPY ./docker/ssl/nginx.key /etc/nginx/ssl/nginx.key
# php conf
RUN mkdir -p /var/run/php
COPY ./docker/www.conf /etc/php/7.3/fpm/pool.d/www.conf
# supervisord conf
COPY ./docker/supervisord.conf /etc/supervisord.conf
COPY ./docker/entrypoint.sh /entrypoint.sh
RUN chmod 775 /entrypoint.sh
# add PHP files
COPY ./app /usr/share/nginx/html/app
COPY ./public /usr/share/nginx/html/public
COPY ./src /usr/share/nginx/html/src
COPY ./vendor /usr/share/nginx/html/vendor
WORKDIR /storage/uploads
RUN chown -Rf www-data.www-data /storage/uploads && chmod -Rf 0755 /storage/uploads
WORKDIR /storage/cache
RUN chown -Rf www-data.www-data /storage/cache && chmod -Rf 0755 /storage/cache
EXPOSE 80
CMD ["/bin/bash", "/entrypoint.sh"]