diff options
| -rw-r--r-- | Dockerfile | 15 | ||||
| -rw-r--r-- | README.md | 22 | ||||
| -rw-r--r-- | docker-compose.yml | 12 |
3 files changed, 44 insertions, 5 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..98c4f35 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM node:18 as build + +WORKDIR /app +COPY package.json yarn.lock . + +RUN yarn install --all +COPY . . +RUN yarn build + + +FROM busybox:1.36 +RUN adduser -D static +WORKDIR /home/static +COPY --from=build /app/public . +CMD ["busybox", "httpd", "-f", "-v", "-p", "3333"] @@ -1,17 +1,29 @@ -# Prerequisites : +# Local +## Prerequisites : - Node v12 (or higher): `brew install node` - Yarn: `brew install yarn` -# Installation : +## Installation : - Clone the repo. - Run `yarn install` -# Development : +## Development : - Run `yarn start` -# Build : +## Build : - Run `yarn build` -# Deploy : +## Deploy : - Run `yarn build` - Copy the generated `public` directory to any hosting environment. (`srht.site`) + +# Docker +## Prerequisites: +- Docker: `brew install docker` + +## Build +- Run `docker build . -t website` +- Run `docker run -p 3333:3333 -it website` +or +- Run `docker-compose build` +- Run `docker-compose up` diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..ee233c5 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +version: "3.9" + +services: + website: + container_name: website + image: website + build: + context: . + dockerfile: Dockerfile + restart: always + ports: + - "3333:3333" |
