-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathDockerfile
More file actions
57 lines (43 loc) · 2.31 KB
/
Dockerfile
File metadata and controls
57 lines (43 loc) · 2.31 KB
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
FROM dreamfactorysoftware/df-base-img:v7
# Configure Nginx
COPY dreamfactory.conf /etc/nginx/sites-available/dreamfactory.conf
# Get DreamFactory
ARG BRANCH=master
RUN git clone --branch $BRANCH https://github.com/dreamfactorysoftware/dreamfactory.git /opt/dreamfactory
WORKDIR /opt/dreamfactory
# Create storage structure and set permissions first
RUN mkdir -p /opt/dreamfactory/storage/app \
&& mkdir -p /opt/dreamfactory/storage/framework/cache \
&& mkdir -p /opt/dreamfactory/storage/framework/sessions \
&& mkdir -p /opt/dreamfactory/storage/framework/views \
&& mkdir -p /opt/dreamfactory/storage/logs \
&& mkdir -p /opt/dreamfactory/bootstrap/cache \
&& chown -R www-data:www-data /opt/dreamfactory/storage \
&& chown -R www-data:www-data /opt/dreamfactory/bootstrap/cache \
&& chmod -R 775 /opt/dreamfactory/storage \
&& chmod -R 775 /opt/dreamfactory/bootstrap/cache
# Add commercial files if running a licensed version
#COPY composer.* /opt/dreamfactory/
# Add access key to pull the private packages
#RUN composer config --global --auth github-oauth.github.com "DF_ACCESS_KEY"
# Clear composer cache and install packages
RUN composer clear-cache && \
COMPOSER_MEMORY_LIMIT=-1 composer install --no-dev --ignore-platform-reqs --no-scripts && \
COMPOSER_MEMORY_LIMIT=-1 composer install --no-dev --ignore-platform-reqs && \
php artisan df:env --db_connection=sqlite --df_install=Docker && \
chown -R www-data:www-data /opt/dreamfactory && \
rm /etc/nginx/sites-enabled/default
# Install MCP daemon Node.js dependencies (if the daemon package is present)
RUN if [ -f /opt/dreamfactory/vendor/dreamfactory/df-mcp-server/daemon/package.json ]; then \
cd /opt/dreamfactory/vendor/dreamfactory/df-mcp-server/daemon && \
npm install --production; \
fi
# Replace YOUR_LICENSE_KEY with your license key, keeping the comma at the end
#RUN sed -i "s,\#DF_REGISTER_CONTACT=,DF_LICENSE_KEY=YOUR_LICENSE_KEY," /opt/dreamfactory/.env
COPY docker-entrypoint.sh /docker-entrypoint.sh
# Set proper permission to docker-entrypoint.sh script and forward error logs to docker log collector
RUN chmod +x /docker-entrypoint.sh && ln -sf /dev/stderr /var/log/nginx/error.log
# Clean up
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
EXPOSE 80
CMD ["/docker-entrypoint.sh"]