Commit 6efab5a1 by Christophe Angeli

use alpine

parent 15390adc
FROM debian:stretch
FROM alpine:3.5
ENV RESTYABOARD_VERSION=v0.4.2 \
ROOT_DIR=/usr/share/nginx/html \
CONF_FILE=/etc/nginx/conf.d/restyaboard.conf \
CONF_DIR=/etc/nginx/conf.d \
SMTP_DOMAIN=localhost \
SMTP_USERNAME=root \
SMTP_PASSWORD=root \
SMTP_SERVER=localhost \
SMTP_PORT=465
# update & install package
RUN apt-get update && \
echo "postfix postfix/mailname string localhost" | debconf-set-selections && \
echo "postfix postfix/main_mailer_type string 'Internet Site'" | debconf-set-selections && \
TERM=linux DEBIAN_FRONTEND=noninteractive apt-get install -y \
cron \
# install packages
RUN apk add --update \
curl \
file \
imagemagick \
jq \
libpq5 \
nginx \
php7.0 \
php7.0-cli \
php7.0-common \
php7.0-curl \
php7.0-fpm \
php7.0-imagick \
php7.0-imap \
php7.0-ldap \
php7.0-mbstring \
php7.0-pgsql \
php7.0-xml \
php7 \
postfix \
postgresql-client \
unzip
unzip && \
rm -rf /var/cache/apk/*
# deploy app
# deploy app and extensions
RUN curl -L -s -o /tmp/restyaboard.zip https://github.com/RestyaPlatform/board/releases/download/${RESTYABOARD_VERSION}/board-${RESTYABOARD_VERSION}.zip && \
mkdir -p ${ROOT_DIR} && \
unzip /tmp/restyaboard.zip -d ${ROOT_DIR} && \
rm /tmp/restyaboard.zip
# extensions
RUN curl -L -s -o /tmp/apps.json https://raw.githubusercontent.com/RestyaPlatform/board-apps/master/apps.json && \
rm /tmp/restyaboard.zip && \
curl -L -s -o /tmp/apps.json https://raw.githubusercontent.com/RestyaPlatform/board-apps/master/apps.json && \
chmod -R go+w /tmp/apps.json && \
mkdir -p "${ROOT_DIR}/client/apps" && \
for fid in $(jq -r '.[] | .id + "-v" + .version' /tmp/apps.json); \
......@@ -52,24 +38,22 @@ RUN curl -L -s -o /tmp/apps.json https://raw.githubusercontent.com/RestyaPlatfor
done && \
rm /tmp/apps.json
# setting app
WORKDIR ${ROOT_DIR}
RUN rm /etc/nginx/sites-enabled/default && \
cp restyaboard.conf ${CONF_FILE} && \
sed -i "s/server_name.*$/server_name \"localhost\";/" ${CONF_FILE} && \
sed -i "s|listen 80.*$|listen 80;|" ${CONF_FILE} && \
sed -i "s|root.*html|root ${ROOT_DIR}|" ${CONF_FILE} && \
chown -R www-data:www-data . && \
chmod -R 777 media && \
chmod -R 777 client/img && \
chmod -R 777 tmp
# cleanup
RUN apt-get autoremove -y --purge && \
apt-get clean
# configure app
RUN addgroup -g 82 -S www-data ; \
adduser -u 82 -D -S -G www-data www-data && \
mkdir -p ${CONF_DIR} && \
cp ${ROOT_DIR}/restyaboard.conf ${CONF_DIR} && \
sed -i "s/server_name.*$/server_name \"localhost\";/" ${CONF_DIR}/restyaboard.conf && \
sed -i "s|listen 80.*$|listen 80;|" ${CONF_DIR}/restyaboard.conf && \
sed -i "s|root.*html|root ${ROOT_DIR}|" ${CONF_DIR}/restyaboard.conf && \
chown -R www-data:www-data ${ROOT_DIR} && \
chmod -R 777 ${ROOT_DIR}/media && \
chmod -R 777 ${ROOT_DIR}/client/img && \
chmod -R 777 ${ROOT_DIR}/tmp
# entry point
# entrypoint
COPY docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh
WORKDIR ${ROOT_DIR}
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["start"]
......@@ -20,12 +20,10 @@ services:
- SMTP_PORT=465
depends_on:
- postgres
networks:
- restya-net
restart: always
postgres:
image: postgres:9.6
image: kiasaki/alpine-postgres:9.6
ports:
- 5432:5432
environment:
......@@ -33,9 +31,4 @@ services:
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=admin
- POSTGRES_DB=restyaboard
networks:
- restya-net
restart: always
networks:
restya-net:
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