Simplify, have just 1 Dockerfile
This commit is contained in:
parent
36a961181a
commit
34efc06607
12
.drone.yml
12
.drone.yml
|
@ -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
|
||||||
|
|
19
Dockerfile
19
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
|
FROM nginx:alpine
|
||||||
|
|
||||||
|
COPY --from=0 /phanpy/dist /usr/share/nginx/html
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
COPY output/ /usr/share/nginx/html
|
|
||||||
|
|
|
@ -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
|
|
||||||
|
|
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue