Skip to content

Commit 48a859b

Browse files
Merge pull request #77 from solidusio/waiting-for-dev/docker
Add Docker development environment
2 parents 5e05baa + 96a1800 commit 48a859b

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed

.dockerdev/Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
ARG NODE_VERSION
2+
FROM node:$NODE_VERSION-slim
3+
4+
RUN apt-get update -qq \
5+
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
6+
build-essential \
7+
curl \
8+
git \
9+
&& rm -rf /var/cache/apt/lists/*
10+
11+
ENV APP_USER=solidusio_user \
12+
LANG=C.UTF-8
13+
ENV APP_HOME=/home/$APP_USER/app
14+
15+
RUN useradd -ms /bin/bash $APP_USER
16+
17+
USER $APP_USER
18+
19+
RUN mkdir -p /home/$APP_USER/history
20+
21+
WORKDIR /home/$APP_USER/app

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,20 @@ $ yarn start
2121
This command starts a local development server and opens up a browser window. Most changes are reflected live without
2222
having to restart the server.
2323

24+
## Docker development
25+
26+
```
27+
$ docker-compose up -d
28+
```
29+
30+
Wait for the `app` container to be ready (you can check the logs with `docker-compose logs -f app`).
31+
32+
```
33+
$ docker-compose exec app yarn start -h 0.0.0.0
34+
```
35+
36+
Now you can access the documentation at http://localhost:3000.
37+
2438
## Deployment
2539

2640
There's nothing special to do here: this website is published via Cloudflare Pages. All PRs generate a preview

docker-compose.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
version: '3.7'
2+
3+
services:
4+
app:
5+
build:
6+
context: .dockerdev
7+
dockerfile: Dockerfile
8+
args:
9+
NODE_VERSION: 19
10+
image: solidus-edgeguides
11+
command: bash -c "(yarn check || yarn install --check-files) && tail -f /dev/null"
12+
environment:
13+
HISTFILE: "/home/solidusio_user/history/bash_history"
14+
ports:
15+
- "${SERVER_PORT:-3000}:${SERVER_PORT:-3000}"
16+
volumes:
17+
- .:/home/solidusio_user/app:delegated
18+
- history:/home/solidusio_user/history:cached
19+
tty: true
20+
stdin_open: true
21+
tmpfs:
22+
- /tmp
23+
24+
volumes:
25+
history:

0 commit comments

Comments
 (0)