Skip to content

Commit

Permalink
ADD docker file (#250)
Browse files Browse the repository at this point in the history
* init - 1G  py3 image

* docker file

* Update docker file
  • Loading branch information
zhaoye authored Nov 19, 2019
1 parent 1cc2d47 commit 5effbc8
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
*/*/__pycache__
.github
.pytest_cache
.vscode
build
dist
data
docs
image
*.egg-info
venv
tmp
tests
*/node_modules
40 changes: 40 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Build FE
FROM node:10.16.3 as nodeos

COPY . /usr/src/app

WORKDIR /usr/src/app/frontend

RUN npm install \
&& npm run build

# Build lyrebird
FROM python:3.7.5 as pyos

COPY . /usr/src/app

WORKDIR /usr/src/app

COPY --from=nodeos /usr/src/app/lyrebird/client/ /usr/src/app/lyrebird/client/

RUN pip install --upgrade pip==19.3.1 \
&& pip install . -i https://pypi.douban.com/simple \
&& rm -rf /usr/src/app

# Make lyrebird image
FROM python:3.7.5-slim

COPY --from=pyos /usr/local/lib/python3.7/site-packages /usr/local/lib/python3.7/site-packages
COPY --from=pyos /usr/local/bin /usr/local/bin

RUN apt-get update && apt-get install -y --no-install-recommends git=1:2.20.1-2 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

EXPOSE 9090
EXPOSE 4272

ENV LC_ALL=C.UTF-8
ENV LANG C.UTF-8

CMD [ "lyrebird" ]

0 comments on commit 5effbc8

Please sign in to comment.