-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: settings dockerfile for app, docs (#106)
- Loading branch information
Showing
3 changed files
with
147 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,77 @@ | ||
FROM python:3.6.0 | ||
|
||
FROM python:3.6.1-alpine | ||
MAINTAINER Luis Mayta <@slovacus> | ||
|
||
LABEL NAME python | ||
LABEL VERSION 3.6.1 | ||
|
||
ENV PACKAGES nginx supervisor bash git libmagic | ||
ENV PACKAGES_DEPENDENCES git \ | ||
gcc \ | ||
make \ | ||
musl-dev \ | ||
libc-dev \ | ||
libmagic \ | ||
gcc \ | ||
zlib-dev \ | ||
linux-headers \ | ||
build-base \ | ||
musl \ | ||
musl-dev \ | ||
build-base \ | ||
openssl \ | ||
pcre-dev | ||
# By default, allow unlimited file sizes, modify it to limit the file sizes | ||
# To have a maximum of 1 MB (Nginx's default) change the line to: | ||
# ENV NGINX_MAX_UPLOAD 1m | ||
ENV NGINX_MAX_UPLOAD 0 | ||
|
||
COPY ./requirements/ /usr/src/requirements/ | ||
COPY ./requirements.txt /usr/src/requirements.txt | ||
|
||
# set working directory to /app/ | ||
RUN apk add --update --no-cache --virtual .build-deps \ | ||
$PACKAGES_DEPENDENCES \ | ||
&& pip install --force-reinstall -r /usr/src/requirements/test.txt \ | ||
&& find /usr/local \ | ||
\( -type d -a -name test -o -name tests \) \ | ||
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ | ||
-exec rm -rf '{}' + \ | ||
&& runDeps="$( \ | ||
scanelf --needed --nobanner --recursive /usr/local \ | ||
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ | ||
| sort -u \ | ||
| xargs -r apk info --installed \ | ||
| sort -u \ | ||
)" \ | ||
&& apk add --virtual .rundeps $runDeps \ | ||
&& apk del .build-deps \ | ||
&& apk add --update --no-cache $PACKAGES \ | ||
# nginx | ||
&& mkdir -p /run/nginx \ | ||
&& mkdir -p /var/lib/nginx \ | ||
&& mkdir -p /var/lib/nginx/tmp \ | ||
# forward request and error logs to docker log collector | ||
&& ln -sf /dev/stdout /var/log/nginx/access.log \ | ||
&& ln -sf /dev/stderr /var/log/nginx/error.log \ | ||
# Remove default configuration from Nginx | ||
&& rm -rf /etc/nginx/conf.d/default.conf | ||
|
||
# Copy the modified Nginx conf | ||
COPY docker/templates/etc/nginx/nginx.conf /etc/nginx/nginx.conf | ||
COPY docker/templates/etc/nginx/conf.d/nginx.conf /etc/nginx/conf.d/ | ||
# Custom Supervisord config | ||
COPY docker/templates/etc/supervisord.conf /etc/ | ||
COPY docker/templates/etc/supervisor/conf.d/supervisord.conf /etc/supervisor/conf.d/supervisord.conf | ||
|
||
EXPOSE 80 | ||
|
||
# Copy the entrypoint that will generate Nginx additional configs | ||
COPY entrypoint.sh /entrypoint.sh | ||
RUN chmod +x /entrypoint.sh | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] | ||
|
||
# Add demo app | ||
COPY ./ /usr/src | ||
WORKDIR /usr/src | ||
|
||
# install python dependencies | ||
RUN pip install -r /usr/src/requirements/test.txt | ||
CMD ["/usr/bin/supervisord", "-n"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,77 @@ | ||
FROM python:3.6.0 | ||
|
||
FROM python:3.6.1-alpine | ||
MAINTAINER Luis Mayta <@slovacus> | ||
|
||
LABEL NAME python | ||
LABEL VERSION 3.6.1 | ||
|
||
ENV PACKAGES nginx supervisor bash git libmagic | ||
ENV PACKAGES_DEPENDENCES git \ | ||
gcc \ | ||
make \ | ||
musl-dev \ | ||
libc-dev \ | ||
libmagic \ | ||
gcc \ | ||
zlib-dev \ | ||
linux-headers \ | ||
build-base \ | ||
musl \ | ||
musl-dev \ | ||
build-base \ | ||
openssl \ | ||
pcre-dev | ||
# By default, allow unlimited file sizes, modify it to limit the file sizes | ||
# To have a maximum of 1 MB (Nginx's default) change the line to: | ||
# ENV NGINX_MAX_UPLOAD 1m | ||
ENV NGINX_MAX_UPLOAD 0 | ||
|
||
COPY ./requirements/ /usr/src/requirements/ | ||
COPY ./requirements.txt /usr/src/requirements.txt | ||
|
||
# set working directory to /app/ | ||
RUN apk add --update --no-cache --virtual .build-deps \ | ||
$PACKAGES_DEPENDENCES \ | ||
&& pip install --force-reinstall -r /usr/src/requirements.txt \ | ||
&& find /usr/local \ | ||
\( -type d -a -name test -o -name tests \) \ | ||
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ | ||
-exec rm -rf '{}' + \ | ||
&& runDeps="$( \ | ||
scanelf --needed --nobanner --recursive /usr/local \ | ||
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ | ||
| sort -u \ | ||
| xargs -r apk info --installed \ | ||
| sort -u \ | ||
)" \ | ||
&& apk add --virtual .rundeps $runDeps \ | ||
&& apk del .build-deps \ | ||
&& apk add --update --no-cache $PACKAGES \ | ||
# nginx | ||
&& mkdir -p /run/nginx \ | ||
&& mkdir -p /var/lib/nginx \ | ||
&& mkdir -p /var/lib/nginx/tmp \ | ||
# forward request and error logs to docker log collector | ||
&& ln -sf /dev/stdout /var/log/nginx/access.log \ | ||
&& ln -sf /dev/stderr /var/log/nginx/error.log \ | ||
# Remove default configuration from Nginx | ||
&& rm -rf /etc/nginx/conf.d/default.conf | ||
|
||
# Copy the modified Nginx conf | ||
COPY docker/templates/etc/nginx/nginx.conf /etc/nginx/nginx.conf | ||
COPY docker/templates/etc/nginx/conf.d/nginx.conf /etc/nginx/conf.d/ | ||
# Custom Supervisord config | ||
COPY docker/templates/etc/supervisord.conf /etc/ | ||
COPY docker/templates/etc/supervisor/conf.d/supervisord.conf /etc/supervisor/conf.d/supervisord.conf | ||
|
||
EXPOSE 80 | ||
|
||
# Copy the entrypoint that will generate Nginx additional configs | ||
COPY entrypoint.sh /entrypoint.sh | ||
RUN chmod +x /entrypoint.sh | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] | ||
|
||
# Add demo app | ||
COPY ./ /usr/src | ||
WORKDIR /usr/src | ||
|
||
# install python dependencies | ||
RUN pip install -r /usr/src/requirements/dev.txt | ||
CMD ["/usr/bin/supervisord", "-n"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
FROM labpositiva/latex:3.6.1 | ||
MAINTAINER Luis Mayta <@slovacus> | ||
|
||
COPY ./requirements/ /app/requirements/ | ||
COPY ./requirements.txt /app/requirements.txt | ||
LABEL NAME python | ||
LABEL VERSION 3.6.1 | ||
|
||
RUN apt-get update -y \ | ||
&& apt-get install -y build-essential | ||
COPY ./requirements/ /usr/src/requirements/ | ||
COPY ./requirements.txt /usr/src/requirements.txt | ||
|
||
# set working directory to /app/ | ||
WORKDIR /app | ||
# set working directory to /usr/src | ||
WORKDIR /usr/src | ||
|
||
# Install sphinx dependences | ||
RUN pip install -r /app/requirements/docs.txt | ||
RUN pip install --force-reinstall -r /usr/src/requirements/docs.txt |