Simplify, have just 1 Dockerfile

This commit is contained in:
Benjamin Bach 2024-01-06 14:08:17 +01:00
parent 36a961181a
commit 34efc06607
No known key found for this signature in database
GPG key ID: 486F0D69C845416E
4 changed files with 19 additions and 34 deletions

View file

@ -2,18 +2,6 @@ kind: pipeline
name: default name: default
steps: 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 # stable site
- name: docker_stable - name: docker_stable

View file

@ -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 FROM nginx:alpine
COPY --from=0 /phanpy/dist /usr/share/nginx/html
EXPOSE 80 EXPOSE 80
COPY output/ /usr/share/nginx/html

View file

@ -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

View file

@ -3,7 +3,7 @@
This is an experiment. To build and run locally: 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: To run the container in the background: