diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +node_modules diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..42bbb29 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +FROM node:alpine + +EXPOSE 8000 + +RUN apk update && \ + apk add --update --repository http://dl-3.alpinelinux.org/alpine/edge/testing \ + vips-tools \ + vips-dev \ + fftw-dev \ + gcc \ + g++ \ + git \ + make \ + autoconf \ + automake \ + bash \ + libc6-compat \ + lcms2-dev \ + libpng-dev \ + && rm -rf /var/cache/apk/* + +RUN npm install --global gatsby-cli --no-optional + +RUN mkdir -p /portfolio +WORKDIR /portfolio +VOLUME /portfolio + +COPY ./scripts/entry.sh / +RUN chmod +x /entry.sh +ENTRYPOINT ["/entry.sh"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..829f513 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +version: '3' +services: + gatsby: + build: . + volumes: + - .:/portfolio + ports: + - "8000:8000" diff --git a/package.json b/package.json index d6cf31c..7160fda 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "lint:css": "stylelint ./src/**/*.{css,scss}", "lint": "npm run lint:js && npm run lint:css", "build": "gatsby build", - "start": "gatsby develop", + "start": "docker-compose up", "format": "prettier --write 'src/**/*.{js,jsx}'", "format:css": "prettier-stylelint --write --quiet 'src/**/*.{css,scss}'", "test": "npm run lint", diff --git a/scripts/entry.sh b/scripts/entry.sh new file mode 100644 index 0000000..56e201c --- /dev/null +++ b/scripts/entry.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -e + +export PATH="$PATH:/usr/local/bin/gatsby" + +# echo "Running npm install..." +# npm install + +# rm -rf ./public +gatsby develop --host 0.0.0.0