diff --git a/Dockerfile b/Dockerfile index 8da41ec2f06..147c2c2d6a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,24 +4,16 @@ FROM node:18-alpine WORKDIR /usr/src/app # Install dependencies -RUN apk --no-cache add g++ gcc libgcc libstdc++ linux-headers make python3 tini -RUN ln -s /usr/bin/python3 /usr/bin/python +RUN apk --no-cache add g++ gcc libgcc libstdc++ linux-headers make vips-dev python3 tini git RUN npm install --quiet node-gyp -g # Add Tini ENTRYPOINT ["/sbin/tini", "--"] -# Install app dependencies -COPY package.json . -COPY package-lock.json . -RUN npm ci --only=production - -# Make sure to get latest -ADD "https://www.random.org/cgi-bin/randbyte?nbytes=10&format=h" skipcache - # Bundle app source COPY . . +# Install app dependencies +RUN npm ci + EXPOSE 80 8080 -WORKDIR "platform" -ENV NODE_ENV=production -CMD ["node", "serve.js"] +CMD ["/bin/sh"] diff --git a/Dockerfile.development b/Dockerfile.development deleted file mode 100644 index f2f23a46813..00000000000 --- a/Dockerfile.development +++ /dev/null @@ -1,27 +0,0 @@ -FROM python:3.11.4-slim-buster -ENV PYTHONUNBUFFERED 1 - -RUN \ - apt-get update --yes --quiet && apt-get install --yes --quiet --no-install-recommends \ - build-essential \ - git \ - libyaml-dev \ - curl && \ - pip install -U pip && pip install grow && \ - rm -rf /var/lib/apt/lists/* - -RUN \ - curl -sL https://deb.nodesource.com/setup_16.x | bash - && \ - apt-get install -y nodejs && \ - npm i -g npm && \ - npm install -g gulp - -RUN mkdir /amp-dev -COPY . /amp-dev/ -WORKDIR /amp-dev/ - -RUN npm install - -EXPOSE 8080 8080 -WORKDIR /amp-dev/platform -CMD ["gulp", "develop"] \ No newline at end of file diff --git a/README.md b/README.md index b3eb08417c0..5bec60bf224 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,8 @@ You can contribute your changes back to the main repository by [creating a pull ## Setup with Docker -We provide a Dockerfile for development based on one of the official Python-images. When using this you can skip setting up Python and a local installation of Grow on your machine. Though make sure you completed all other installation steps, like cloning the repository, installing all Node.js dependencies and exporting a valid GitHub token as outlined in [Fork & clone the repository](#fork--clone-the-repository) and [Develop](#develop). When those steps are completed instead of running the project with `npm run develop` you can build a development Docker image with the followiung command, run from the project root directory: +We provide a Dockerfile for development based on one of the official Python-images. When using this you can skip setting up Python and a local installation of Grow on your machine. Though make sure you completed all other installation steps, like cloning the repository, installing all Node.js dependencies and exporting a valid GitHub token as outlined in [Fork & clone the repository](#fork--clone-the-repository) and [Develop](#develop). When those steps are completed instead of running the project with `npm run develop` you can build a Docker image with the followiung command, run from within the Docker container: + ```sh $ npx gulp developImageBuild