Skip to content
Snippets Groups Projects
Commit a95ecd88 authored by Pierre Guilleminot's avatar Pierre Guilleminot
Browse files

Update doc on docker dev

parent 4cdaadac
No related branches found
No related tags found
No related merge requests found
...@@ -48,20 +48,20 @@ If you do not want to install the required dependencies, we provide a Docker ima ...@@ -48,20 +48,20 @@ If you do not want to install the required dependencies, we provide a Docker ima
To run a ephemeral instance, on the `$HOME/myapp` directory, use the following command (warning: all the data stored by your application in couchdb and the VFS won't remain after): To run a ephemeral instance, on the `$HOME/myapp` directory, use the following command (warning: all the data stored by your application in couchdb and the VFS won't remain after):
```sh ```sh
$ docker run -d \ $ docker run -it \
-p 8080:8080 \ -p 8080:8080 \
-v "$HOME/myapp":/data/cozy-app \ -v "$HOME/myapp":/data/cozy-app \
cozy:cozy-app-dev cozy/cozy-app-dev
``` ```
To keep your data even when stopping the container, run the following command: To keep your data even when stopping the container, run the following command:
```sh ```sh
$ docker run -d \ $ docker run -it \
-p 8080:8080 \ -p 8080:8080 \
-v "$HOME/myapp":/data/cozy-app \ -v "$HOME/myapp":/data/cozy-app \
-v "$(pwd)":/usr/local/couchdb/data \ -v "$(pwd)":/usr/local/couchdb/data \
cozy:cozy-app-dev cozy/cozy-app-dev
``` ```
You can also expose the couchdb port (listening in the container on 5984) in order to access its admin page. For instance add `-p 1234:5984` to access to the admin interface on `http://localhost:1234/_utils`. You can also expose the couchdb port (listening in the container on 5984) in order to access its admin page. For instance add `-p 1234:5984` to access to the admin interface on `http://localhost:1234/_utils`.
...@@ -4,17 +4,9 @@ ...@@ -4,17 +4,9 @@
FROM debian:jessie FROM debian:jessie
ENV COUCHDB_VERSION 2.0.0
ENV COUCHDB_SRC_URL https://dist.apache.org/repos/dist/release/couchdb/source/2.0.0/apache-couchdb-$COUCHDB_VERSION.tar.gz
ENV COUCHDB_SRC_SHA256 ccaf3ce9cb06c50a73e091696e557e2a57c5ba02c5b299e1ac2f5b959ee96eca
ENV GOLANG_VERSION 1.7.3
ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
ENV GOLANG_DOWNLOAD_SHA256 508028aac0654e993564b6e2014bf2d4a9751e3b286661b0b0040046cf18028e
# CouchDB and CGo dependencies # CouchDB and CGo dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \
bash \
git \ git \
ca-certificates \ ca-certificates \
curl \ curl \
...@@ -32,7 +24,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ ...@@ -32,7 +24,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Go # Golang
ENV GOLANG_VERSION 1.7.4
ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
ENV GOLANG_DOWNLOAD_SHA256 47fda42e46b4c3ec93fa5d4d4cc6a748aa3f9411a2a2b7e08e3a6d80d753ec8b
RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \ RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \
&& echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - \ && echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - \
&& tar -xzf golang.tar.gz -C /usr/local \ && tar -xzf golang.tar.gz -C /usr/local \
...@@ -48,6 +43,9 @@ RUN go get github.com/mholt/caddy/caddy \ ...@@ -48,6 +43,9 @@ RUN go get github.com/mholt/caddy/caddy \
# CouchDB # CouchDB
ENV COUCHDB_VERSION 2.0.0
ENV COUCHDB_SRC_URL https://dist.apache.org/repos/dist/release/couchdb/source/2.0.0/apache-couchdb-$COUCHDB_VERSION.tar.gz
ENV COUCHDB_SRC_SHA256 ccaf3ce9cb06c50a73e091696e557e2a57c5ba02c5b299e1ac2f5b959ee96eca
RUN mkdir /usr/src/couchdb \ RUN mkdir /usr/src/couchdb \
&& curl -fsSL "$COUCHDB_SRC_URL" -o couchdb.tar.gz \ && curl -fsSL "$COUCHDB_SRC_URL" -o couchdb.tar.gz \
&& echo "$COUCHDB_SRC_SHA256 couchdb.tar.gz" | sha256sum -c - \ && echo "$COUCHDB_SRC_SHA256 couchdb.tar.gz" | sha256sum -c - \
...@@ -56,8 +54,8 @@ RUN mkdir /usr/src/couchdb \ ...@@ -56,8 +54,8 @@ RUN mkdir /usr/src/couchdb \
&& cd /usr/src/couchdb \ && cd /usr/src/couchdb \
&& ./configure --disable-docs \ && ./configure --disable-docs \
&& make release \ && make release \
&& mv ./rel/couchdb /usr/local && mv ./rel/couchdb /usr/local \
&& rm -rf /usr/src/couchdb
ENV PATH $PATH:/usr/local/couchdb/bin ENV PATH $PATH:/usr/local/couchdb/bin
...@@ -67,9 +65,7 @@ RUN apt-get purge -y \ ...@@ -67,9 +65,7 @@ RUN apt-get purge -y \
libicu-dev \ libicu-dev \
libmozjs185-dev \ libmozjs185-dev \
&& apt-get autoremove -y \ && apt-get autoremove -y \
&& apt-get clean \ && apt-get clean
&& rm -rf /usr/src/couchdb
COPY cozy-app-dev.sh /usr/bin COPY cozy-app-dev.sh /usr/bin
RUN chmod +x /usr/bin/cozy-app-dev.sh RUN chmod +x /usr/bin/cozy-app-dev.sh
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment