Skip to content
This repository has been archived by the owner on Apr 9, 2020. It is now read-only.

Commit

Permalink
Merge conflict changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dmlyons2 committed Oct 10, 2019
2 parents 29b055f + 74882ca commit 94d3873
Show file tree
Hide file tree
Showing 39 changed files with 972 additions and 1,020 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,5 @@ venv.bak/
# mypy
.mypy_cache/

# node modules
requirements/node_modules/
node_modules/
.vscode
/static
83 changes: 15 additions & 68 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,78 +1,25 @@
# NPM build stage
# dep at
# /node_modules -> /node_modules
FROM alpine:3.9 AS npmbuild
RUN apk add --no-cache \
git \
nodejs \
npm
COPY ./requirements/package*.json /
RUN npm install
FROM python:3-alpine

# Python build stage
# dep at
# /wheels/dev -> /wheels
# /wheels/prod -> /wheels
# /wheels/test -> /wheels
FROM alpine:3.9 AS pybuild
RUN apk add --no-cache \
g++ \
git \
libxml2-dev \
libxslt-dev \
linux-headers \
mariadb-dev \
python3-dev
COPY ./requirements/base.txt /requirements/base.txt
COPY ./requirements/dev.txt /requirements/dev.txt
COPY ./requirements/prod.txt /requirements/prod.txt
COPY ./requirements/test.txt /requirements/test.txt
RUN pip3 install wheel
WORKDIR /wheels/dev
RUN pip3 wheel -r /requirements/dev.txt \
&& pip3 install /wheels/dev/*
WORKDIR /wheels/test
RUN pip3 wheel -r /requirements/test.txt \
&& pip3 install /wheels/test/*
WORKDIR /wheels/prod
RUN pip3 wheel -r /requirements/prod.txt \
&& pip3 install /wheels/prod/*

# Dev
FROM alpine:3.9 AS dev
RUN apk add --no-cache \
g++ \
git \
linux-headers \
mariadb-dev \
nodejs \
python3-dev
WORKDIR /wheels/
COPY --from=pybuild /wheels/dev/ /wheels/
RUN ln -s /usr/bin/python3 /usr/bin/python \
&& pip3 install --no-cache-dir /wheels/* \
&& rm -rf /wheels
COPY --from=npmbuild /node_modules /node_modules
RUN addgroup -g 1000 factotum && \
adduser -D -u 1000 -G factotum factotum
USER 1000
ENTRYPOINT ["python3", "/app/manage.py"]
CMD ["runserver"]
WORKDIR /app
VOLUME /app
EXPOSE 5000
COPY requirements.txt /requirements.txt
RUN pip3 --no-cache-dir install -r /requirements.txt \
&& rm /requirements.txt

# Production
FROM alpine:3.9 AS prod
RUN apk add --no-cache \
g++ \
git \
linux-headers \
mariadb-dev \
python3-dev
WORKDIR /wheels
COPY --from=pybuild /wheels/prod /wheels
RUN ln -s /usr/bin/python3 /usr/bin/python \
&& pip3 install --no-cache-dir /wheels/* \
&& rm -rf /wheels
COPY . /app/.
ENTRYPOINT ["python3", "/app/manage.py"]
CMD ["runserver"]
WORKDIR /app
RUN rm -rf static \
&& python3 manage.py collectstatic

CMD gunicorn config.wsgi -c config/gunicorn.conf --log-config config/logging.conf

EXPOSE 8001
VOLUME /app/static

Loading

0 comments on commit 94d3873

Please sign in to comment.