2021-03-08 21:32:04 +05:30
|
|
|
## Warning
|
|
|
|
|
2021-02-08 17:13:53 +05:30
|
|
|
Usage of docker is a third-party contribution and not actively tested, used or supported by the main developer(s).
|
|
|
|
|
2021-03-08 21:32:04 +05:30
|
|
|
Having said that, you can also use Docker to create a local dev environment or a production deployment.
|
|
|
|
|
|
|
|
## Dev environment
|
2021-02-08 17:13:53 +05:30
|
|
|
|
|
|
|
In this repository, create a Docker image:
|
|
|
|
|
2021-03-08 21:32:04 +05:30
|
|
|
```
|
|
|
|
docker build -t hydrogen-dev -f Dockerfile-dev .
|
|
|
|
```
|
2021-02-08 17:13:53 +05:30
|
|
|
|
|
|
|
Then start up a container from that image:
|
|
|
|
|
2021-03-08 21:32:04 +05:30
|
|
|
```
|
|
|
|
docker run \
|
|
|
|
--name hydrogen-dev \
|
|
|
|
--publish 3000:3000 \
|
|
|
|
--volume "$PWD":/code \
|
|
|
|
--interactive \
|
|
|
|
--tty \
|
|
|
|
--rm \
|
|
|
|
hydrogen-dev
|
|
|
|
```
|
2021-02-08 17:13:53 +05:30
|
|
|
|
|
|
|
Then point your browser to `http://localhost:3000`. You can see the server logs in the terminal where you started the container.
|
|
|
|
|
|
|
|
To stop the container, simply hit `ctrl+c`.
|
2021-03-08 21:32:04 +05:30
|
|
|
|
|
|
|
## Production deployment
|
|
|
|
|
|
|
|
### Build or pull image
|
|
|
|
|
|
|
|
In this repository, create a Docker image:
|
|
|
|
|
|
|
|
```
|
|
|
|
docker build -t hydrogen .
|
|
|
|
```
|
|
|
|
|
|
|
|
Or, pull the docker image from GitLab:
|
|
|
|
|
|
|
|
```
|
|
|
|
docker pull registry.gitlab.com/jcgruenhage/hydrogen-web
|
|
|
|
docker tag registry.gitlab.com/jcgruenhage/hydrogen-web hydrogen
|
|
|
|
```
|
|
|
|
|
|
|
|
### Start container image
|
|
|
|
|
|
|
|
Then, start up a container from that image:
|
|
|
|
|
|
|
|
```
|
|
|
|
docker run \
|
|
|
|
--name hydrogen \
|
|
|
|
--publish 80:80 \
|
|
|
|
hydrogen
|
|
|
|
```
|