Skip to content

Commit d3413c4

Browse files
committed
Run gatsby in docker with docker-compose
1 parent a3e6300 commit d3413c4

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

docker-compose.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: '3.4'
2+
services:
3+
docs:
4+
build:
5+
context: .
6+
dockerfile: docker/Dockerfile
7+
target: docs
8+
image: gruntwork-docs
9+
volumes:
10+
- /usr/src/docs/node_modules
11+
- .:/usr/src/docs
12+
ports:
13+
- 8080:8000

docker/Dockerfile

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM node:8.15-stretch as build
2+
WORKDIR /usr/src
3+
COPY package.json .
4+
COPY yarn.lock .
5+
RUN npm install -g yarn@^1.15 && \
6+
chmod +x /usr/local/bin/yarn && \
7+
yarn -v
8+
RUN yarn install
9+
10+
11+
FROM node:8.15-stretch as docs
12+
WORKDIR /usr/src/docs
13+
RUN npm install -g gatsby-cli@^2.5 && chmod +x /usr/local/bin/gatsby && gatsby -v
14+
COPY --from=build /usr/src/node_modules /usr/src/docs/node_modules
15+
EXPOSE 8000
16+
CMD ["gatsby", "develop", "-H", "0.0.0.0"]

0 commit comments

Comments
 (0)