diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..ff378ef --- /dev/null +++ b/.dockerignore @@ -0,0 +1,11 @@ +* + +!craco.config.js +!tailwind.config.js +!tsconfig.json +!yarn-offline-mirror/ +!src/ +!public/ +!package.json +!yarn.lock +!.yarnrc diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..713a892 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM node:14 as build-deps +WORKDIR /usr/src/app +COPY package.json yarn.lock ./ + +RUN yarn +COPY . ./ +RUN yarn build + +FROM nginx:1.12-alpine +COPY --from=build-deps /usr/src/app/build /usr/share/nginx/html/alon + +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] diff --git a/README.md b/README.md index e5597b8..b1b2695 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,22 @@ Deploy Alon on Github Pages: $ yarn deploy ``` +## Deploy on docker + +Fire it up, building from your local respository with: +```bash +docker-compose up +``` + +Otherwise, you can run a pre built image from dockerhub. Pull and run from dockerhub with the following command: + +```bash +$ docker run -d --name alon -p 80:80 medadnewman/alon_web:latest +``` + +It should pull the latest image and will be viewable at the `/alon` subpage(e.g. `http://localhost/alon/`) + + ## roadmap - Better code/file navigation diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..61d0297 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,7 @@ +version: '3.8' + +services: + web: + build: . + ports: + - "80:80"