From 32355c93845a0d19bfbcc0273e2751f941d6d38f Mon Sep 17 00:00:00 2001 From: Fabio Bonelli Date: Thu, 8 Feb 2024 11:41:32 +0100 Subject: [PATCH] fix: build the Docker image and update the doc Also, copy patches/ into the build stage image, so patch-package can apply the patch properly. Fix #311. --- .dockerignore | 2 +- Dockerfile | 15 ++++++++------- README.md | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.dockerignore b/.dockerignore index 72490fee..0e4f06c8 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,3 @@ .git node_modules -build +dist diff --git a/Dockerfile b/Dockerfile index fd6afdf2..f565c7a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,14 @@ -# Stage 0, "build-stage". -FROM node:lts as build-stage +FROM docker.io/node:18 as build-stage + WORKDIR /app -COPY package*.json /app/ -# First install deps, then copy app and build. +RUN apt-get update \ + && apt-get -y --no-install-recommends install golang-go=2:1.19~1 golang-src=2:1.19~1 + +COPY . /app + RUN npm ci -COPY ./ /app/ RUN npm run build -# Stage 1, "prod-stage". -FROM nginx:1 +FROM docker.io/nginx:1 COPY --from=build-stage /app/dist/ /usr/share/nginx/html diff --git a/README.md b/README.md index af979b1b..8686e622 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ docker build -t publiccode-editor . you can build a Docker image. Subsequently, by running: ```console -docker run -p 8080:8080 publiccode-editor +docker run -p 8080:80 publiccode-editor ``` you can run the Docker container and see the results at [`http://localhost:8080`](http://localhost:8080).