mirror of
https://github.com/kremalicious/blog.git
synced 2024-12-22 17:23:50 +01:00
add Docker for local development
This commit is contained in:
parent
9197962a77
commit
2988e1b44a
16
.dockerignore
Normal file
16
.dockerignore
Normal file
@ -0,0 +1,16 @@
|
||||
node_modules
|
||||
npm-debug.log
|
||||
Dockerfile*
|
||||
docker-compose*
|
||||
.dockerignore
|
||||
.git
|
||||
.gitignore
|
||||
README.md
|
||||
LICENSE
|
||||
.vscode
|
||||
public
|
||||
.cache
|
||||
.travis.yml
|
||||
package-lock.json
|
||||
README.md
|
||||
coverage
|
@ -1,7 +1,6 @@
|
||||
dist: xenial
|
||||
language: node_js
|
||||
node_js:
|
||||
- '12'
|
||||
node_js: node
|
||||
|
||||
git:
|
||||
depth: 10
|
||||
|
25
Dockerfile
Normal file
25
Dockerfile
Normal file
@ -0,0 +1,25 @@
|
||||
# Dockerfile for local development just installing dependencies.
|
||||
# Use together with `docker-compose up`
|
||||
FROM node:alpine
|
||||
|
||||
RUN mkdir -p /blog
|
||||
WORKDIR /blog
|
||||
COPY package.json .
|
||||
|
||||
RUN apk add --no-cache --virtual .build-deps \
|
||||
g++ \
|
||||
make \
|
||||
autoconf \
|
||||
automake \
|
||||
libtool \
|
||||
nasm \
|
||||
libc6-compat \
|
||||
libjpeg-turbo-dev \
|
||||
libpng-dev \
|
||||
git \
|
||||
bash \
|
||||
python \
|
||||
&& rm -rf /var/cache/apk/* \
|
||||
&& npm install \
|
||||
&& npm cache clean --force \
|
||||
&& apk del .build-deps
|
15
README.md
15
README.md
@ -163,20 +163,21 @@ If you want to know how this works, have a look at the respective component unde
|
||||
|
||||
## ✨ Development
|
||||
|
||||
You need to have the following tools installed on your development machine before moving on:
|
||||
|
||||
- [Node.js](http://nodejs.org/)
|
||||
- [npm](https://npmjs.org/)
|
||||
|
||||
Then install dependencies and start everything up:
|
||||
You can simply use [Docker](https://www.docker.com) & [Docker Compose](https://docs.docker.com/compose/) or install and run dependencies on your local system.
|
||||
|
||||
```bash
|
||||
npm i
|
||||
git clone git@github.com:kremalicious/blog.git
|
||||
cd blog/
|
||||
|
||||
# GITHUB_TOKEN is required for some parts
|
||||
cp .env.sample .env
|
||||
vi .env
|
||||
|
||||
# use Docker
|
||||
docker-compose up
|
||||
|
||||
# or go with local system
|
||||
npm i
|
||||
npm start
|
||||
```
|
||||
|
||||
|
10
docker-compose.yml
Normal file
10
docker-compose.yml
Normal file
@ -0,0 +1,10 @@
|
||||
version: '3'
|
||||
services:
|
||||
blog:
|
||||
build: .
|
||||
command: npm run start:docker
|
||||
volumes:
|
||||
- .:/blog
|
||||
- /blog/node_modules
|
||||
ports:
|
||||
- '8000:8000'
|
@ -8,6 +8,7 @@
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start": "gatsby develop",
|
||||
"start:docker": "gatsby develop --host 0.0.0.0",
|
||||
"build": "gatsby build && npm run copy",
|
||||
"ssr": "npm run build && serve -s public/",
|
||||
"test": "npm run lint && jest --coverage",
|
||||
|
Loading…
Reference in New Issue
Block a user