Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds server based on latest master #84

Merged
merged 1 commit into from
Mar 6, 2018
Merged

Adds server based on latest master #84

merged 1 commit into from
Mar 6, 2018

Conversation

tobiasKaminsky
Copy link
Member

This image pulls always latest master and install it at /nc.
Also a test user with "test" password is created.

THis is needed for automated testing on android, as it needs a server to do basic operations on it.

All credits belong to @rullzer

Copy link
Member

@rullzer rullzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine by me.

@MorrisJobke any comments here?

@MorrisJobke
Copy link
Member

Yesterday I noticed that this one had some bugs ... for example are thumbnails broken and not generated. So I migrated my local docker image to be Debian based and have less selfcompiled stuff, but relies more on the real world instances (a Debian with standard packages that are out there).

Dockerfile:

FROM debian:stretch

RUN apt-get update \
    && apt-get install -y \
       php \
       php-curl \
       php-gd \
       php-imagick \
       php-mbstring \
       php-pdo-mysql \
       php-pdo-pgsql \
       php-redis \
       php-sqlite3 \
       php-xml \
       php-zip \
    && apt-get autoremove -y \
    && apt-get autoclean \
    && apt-get clean \
    && rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/*

COPY php.ini /etc/php/7.0/apache2/conf.d/30-php.ini
COPY apache2-foreground /usr/local/bin/

WORKDIR /var/www/html

EXPOSE 80
CMD ["apache2-foreground"]

php.ini for opcache and better performance

opcache.enable=1
opcache.enable_cli=1
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.memory_consumption=128
opcache.save_comments=1
opcache.revalidate_freq=1

My entry point script (basically loads the default environment variables of apache and starts it in the foreground):

#!/bin/bash
set -e

. /etc/apache2/envvars

apache2 -DFOREGROUND "$@"

RUN chsh -s /bin/bash www-data

ADD init.sh /initnc.sh
RUN chmod +x /initnc.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apply this to the file and git commit this then ;)


WORKDIR /var/www/html

RUN git clone https://github.com/nextcloud/server.git nc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you cloning to nc and not to the working dir directly. Then there wouldn't be a need to have it in a subdir like localhost/nc ;)

RUN git clone https://github.com/nextcloud/server.git nc
RUN cd nc && git submodule update --init
RUN chown -R www-data:www-data nc
RUN chsh -s /bin/bash www-data
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any need for this? You could also simply run the process in the container as root ... there isn't anything other in this container anyways ;)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Roeland said that it was not working if /nc is not owned by apache user

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But if you run apache as root it is owned by it ;) At least that is what works totally fine over here ;)

server/init.sh Outdated
cd /var/www/html/nc

#Update code
su www-data -c "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And also you don't need to do this hack if you run apache as root ;)

@tobiasKaminsky
Copy link
Member Author

@MorrisJobke I removed now the www-data stuff, but now I get an internal error, when accessing server.

@tobiasKaminsky
Copy link
Member Author

@MorrisJobke is seems that it has to be run as www-data.
This is working now, but I doubt that all my changes are correctly ;-)

@MorrisJobke
Copy link
Member

Looks good so far. Just try it then you know if it works ;)

@tobiasKaminsky
Copy link
Member Author

This is now working for me 👍

server/init.sh Outdated
php occ config:system:set trusted_domains 1 --value=*
"

bash apache2-foreground
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really? Just copy paste it in here ;)

@MorrisJobke MorrisJobke merged commit 5fa1591 into master Mar 6, 2018
@MorrisJobke MorrisJobke deleted the server branch March 6, 2018 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants