Skip to content

Commit 2699148

Browse files
authored
Added a Dockerfile for easy deployment (#1)
1 parent cb51e16 commit 2699148

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/node_modules
2+
/.docusaurus
3+
/build

Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM node:latest as base
2+
WORKDIR /chargepi/docusaurus/
3+
4+
COPY ./package.json ./package.json
5+
COPY ./package-lock.json ./package-lock.json
6+
7+
RUN npm install
8+
COPY . .
9+
RUN npm run build
10+
11+
FROM nginx:latest as website
12+
13+
COPY --from=base /chargepi/docusaurus/build /usr/share/nginx/html

docker-compose.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
version: '3.1'
1+
version: '3.7'
22
services:
33
chargepi-website:
4-
image: nginx
4+
build:
5+
context: .
6+
target: website
57
volumes:
68
- ./build/:/usr/share/nginx/html/
79
- ./nginx.conf:/etc/nginx/nginx.conf
@@ -19,5 +21,5 @@ services:
1921
- "traefik.docker.network=server"
2022
networks:
2123
default:
22-
external:
24+
external:
2325
name: server

0 commit comments

Comments
 (0)