From 34efc06607afc893a6b3f2cd6df386fd41040df6 Mon Sep 17 00:00:00 2001 From: Benjamin Bach Date: Sat, 6 Jan 2024 14:08:17 +0100 Subject: [PATCH] Simplify, have just 1 Dockerfile --- .drone.yml | 12 ------------ Dockerfile | 19 ++++++++++++++++++- Dockerfile_phanpy | 20 -------------------- README.md | 2 +- 4 files changed, 19 insertions(+), 34 deletions(-) delete mode 100644 Dockerfile_phanpy diff --git a/.drone.yml b/.drone.yml index 4c21e77..1423cff 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,18 +2,6 @@ kind: pipeline name: default steps: - - name: build_stable - image: node:20-alpine - commands: - - git clone https://github.com/cheeaun/phanpy.git - - cd phanpy - - git checkout 2023.12.13.19da64a - - npm install - - npm run build - - cp dist ../output - when: - branch: - - main # stable site - name: docker_stable diff --git a/Dockerfile b/Dockerfile index 3fe65dc..cbc10ef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,20 @@ +FROM node:20-alpine + +RUN apk add git + +RUN cd / && \ + git clone https://github.com/cheeaun/phanpy.git && \ + cd phanpy && \ + git checkout 2023.12.31.8aa0542 + +# builds to /phanpy/dist +RUN cd /phanpy && \ + npm install && \ + npm run build + FROM nginx:alpine + +COPY --from=0 /phanpy/dist /usr/share/nginx/html + EXPOSE 80 -COPY output/ /usr/share/nginx/html + diff --git a/Dockerfile_phanpy b/Dockerfile_phanpy deleted file mode 100644 index cbc10ef..0000000 --- a/Dockerfile_phanpy +++ /dev/null @@ -1,20 +0,0 @@ -FROM node:20-alpine - -RUN apk add git - -RUN cd / && \ - git clone https://github.com/cheeaun/phanpy.git && \ - cd phanpy && \ - git checkout 2023.12.31.8aa0542 - -# builds to /phanpy/dist -RUN cd /phanpy && \ - npm install && \ - npm run build - -FROM nginx:alpine - -COPY --from=0 /phanpy/dist /usr/share/nginx/html - -EXPOSE 80 - diff --git a/README.md b/README.md index 6b13d38..23f68d5 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ This is an experiment. To build and run locally: ``` -docker build . -t phanpy:latest -f Dockerfile_phanpy +docker build . -t phanpy:latest ``` To run the container in the background: