Skip to content

Commit ba65499

Browse files
committed
First updates migrating to docker-compose
1 parent b50a451 commit ba65499

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed

Makefile

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,10 @@ SHELL := /bin/bash
22
CWD := $(shell cd -P -- '$(shell dirname -- "$0")' && pwd -P)
33

44
docker-images:
5-
docker build -t sphinx_rtd_theme:latest .
5+
docker-compose build
66

77
docker-run:
8-
rm -f .container_id
9-
docker run --cidfile=.container_id -t -i -p 1919:1919 \
10-
--network host \
11-
--mount type=bind,source="$(CWD)",target=/project-readonly,readonly \
12-
--mount type=volume,dst=/project-readonly/sphinx_rtd_theme.egg-info,volume-driver=local \
13-
--mount type=bind,source="$(CWD)/src",target=/project/src,readonly \
14-
--mount type=bind,source="$(CWD)/docs",target=/project/docs \
15-
sphinx_rtd_theme:latest $(command)
8+
docker-compose run sphinx_rtd_theme $(command)
169

1710
docker-copy-assets:
1811
docker cp "$(shell cat .container_id):/project/sphinx_rtd_theme" .

docker-compose.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: "3.2"
2+
services:
3+
4+
sphinx_rtd_theme:
5+
build: .
6+
volumes:
7+
- type: "bind"
8+
source: "./"
9+
target: "/project-working-copy"
10+
network_mode: host
11+
ports:
12+
- "1919:1919"

docker-entrypoint.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
# Install the readonly project in editable mode and make sure
44
# all dependencies are upgrade. This is mounted in from the
55
# outside, but it is on purpose that it is readonly!
6-
cd /project-readonly
6+
cp -r /project/node_modules /project-working-copy/
7+
cd /project-working-copy
78
pip install --upgrade -e ".[dev]"
89

9-
cd /project
10-
1110
npm run $@

docs/contributing.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ If you have Docker available on your platform, you can get started building CSS
7575

7676
When building with Docker, we create an image containing the build dependencies. Some of these are quite outdated and therefore ideal to isolate a container. The image is tagged as ``sphinx_rtd_theme:latest``.
7777

78-
Inside the running docker image, we mount the working copy of the repository, build the artifacts and finally copy out those artifacts into your external environment.
78+
Inside the running docker image, we mount the working copy of the repository, build the artifacts and finally observe that the artifacts have been built and left in your current git checkout.
7979

8080
Use the following steps:
8181

@@ -90,9 +90,6 @@ Use the following steps:
9090
# Runs the development webserver
9191
$ make docker-run command=dev
9292
93-
# Copies out the assets from the most recent docker-run
94-
$ make docker-copy-assets
95-
9693
9794
Every time you change the Node or Python requirements, you will need to rebuild images with ``make docker-images``. If you change SASS or JS, you will need to rebuild assets.
9895

0 commit comments

Comments
 (0)