(core) freshen core README; support python3 in grist-core docker image

Summary:
This updates the grist-core README to list specific features of Grist,
to make it easier for a casual visitor to get a sense of its scope. Adds links
to some new resources (reviews, templates, grist v airtable post) that could
also help. Adds python3 to docker image so that templates work without fuss.

Test Plan: existing tests should pass

Reviewers: georgegevoian

Reviewed By: georgegevoian

Subscribers: dsagal, anaisconce

Differential Revision: https://phab.getgrist.com/D3204
This commit is contained in:
Paul Fitzpatrick
2022-01-07 12:06:04 -05:00
parent b37b8a9f6d
commit 5cdc7b2ea4
9 changed files with 194 additions and 79 deletions

View File

@@ -1,5 +1,5 @@
################################################################################
## Build stage
## Javascript build stage
################################################################################
FROM node:14-buster as builder
@@ -18,12 +18,21 @@ ADD static static
ADD test/tsconfig.json test/tsconfig.json
RUN yarn run build:prod
################################################################################
## Python collection stage
################################################################################
# Fetch python3.9 and python2.7
FROM python:3.9-slim-buster as collector
# Install all python dependencies.
ADD sandbox/requirements.txt requirements.txt
ADD sandbox/requirements3.txt requirements3.txt
RUN \
apt update && \
apt install -y python-pip && \
pip install -r requirements.txt
apt install -y --no-install-recommends python2 python-pip python-setuptools && \
pip2 install -r requirements.txt && \
pip3 install -r requirements3.txt
################################################################################
## Run-time stage
@@ -32,16 +41,29 @@ RUN \
# Now, start preparing final image.
FROM node:14-buster-slim
# Install libexpat1, libsqlite3-0 for python3 library binary dependencies.
RUN \
apt-get update && \
apt-get install -y --no-install-recommends libexpat1 libsqlite3-0 && \
rm -rf /var/lib/apt/lists/*
# Keep all storage user may want to persist in a distinct directory
RUN mkdir -p /persist/docs
# Copy node files.
COPY --from=builder /node_modules node_modules
COPY --from=builder /_build _build
COPY --from=builder /static static
# Copy python files. TODO: package python3.9 also in grist-core.
COPY --from=builder /usr/bin/python2.7 /usr/bin/python2.7
COPY --from=builder /usr/lib/python2.7 /usr/lib/python2.7
COPY --from=builder /usr/local/lib/python2.7 /usr/local/lib/python2.7
RUN ln -s /usr/bin/python2.7 /usr/bin/python
# Copy python files.
COPY --from=collector /usr/bin/python2.7 /usr/bin/python2.7
COPY --from=collector /usr/lib/python2.7 /usr/lib/python2.7
COPY --from=collector /usr/local/lib/python2.7 /usr/local/lib/python2.7
COPY --from=collector /usr/local/bin/python3.9 /usr/bin/python3.9
COPY --from=collector /usr/local/lib/python3.9 /usr/local/lib/python3.9
COPY --from=collector /usr/local/lib/libpython3.9.* /usr/local/lib/
# Set default to python3
RUN ln -s /usr/bin/python3.9 /usr/bin/python && ldconfig
# Add files needed for running server.
ADD package.json package.json
@@ -50,13 +72,11 @@ ADD bower_components bower_components
ADD sandbox sandbox
ADD plugins plugins
# Keep all storage user may want to persist in a distinct directory
RUN mkdir -p /persist/docs
# Set some default environment variables to give a setup that works out of the box when
# started as:
# docker run -p 8484:8484 -it <image>
# Variables will need to be overridden for other setups.
ENV PYTHON_VERSION_ON_CREATION=3
ENV GRIST_ORG_IN_PATH=true
ENV GRIST_HOST=0.0.0.0
ENV GRIST_SINGLE_PORT=true