Docker - update fittrackee-client

This commit is contained in:
Sam 2021-11-06 22:18:38 +01:00
parent c7024e6692
commit 1013b5cdca
11 changed files with 100 additions and 241 deletions

View File

@ -16,6 +16,8 @@ export DATABASE_TEST_URL=postgresql://fittrackee:fittrackee@fittrackee-db:5432/f
# Emails
export UI_URL=http://0.0.0.0:5000
# For development:
# export UI_URL=http://0.0.0.0:3000
export EMAIL_URL=smtp://none:none@mail:1025
export SENDER_EMAIL=fittrackee@example.com
export REDIS_URL=redis://redis:6379

View File

@ -54,7 +54,7 @@ docker-run-workers:
docker-serve-client:
docker-compose -f docker-compose-dev.yml up -d fittrackee_client
docker-compose -f docker-compose-dev.yml exec fittrackee_client react-scripts start
docker-compose -f docker-compose-dev.yml exec fittrackee_client yarn serve
docker-shell:
docker-compose -f docker-compose-dev.yml exec fittrackee docker/shell.sh

View File

@ -37,7 +37,7 @@ services:
container_name: fittrackee_client
environment:
- NODE_ENV=development
- REACT_APP_API_URL=http://localhost:5000
- VUE_APP_API_URL=http://localhost:5000
build:
context: ./fittrackee_client
volumes:

View File

@ -191,62 +191,12 @@ deployment method.
**Dark Sky** API key for weather data (not mandatory).
.. envvar:: REACT_APP_API_URL
.. envvar:: VUE_APP_API_URL
**FitTrackee** API URL, only needed in dev environment.
Deprecated variables
^^^^^^^^^^^^^^^^^^^^
.. envvar:: REACT_APP_GPX_LIMIT_IMPORT
.. deprecated:: 0.3.0 now stored in database
Maximum number of gpx file in zip archive.
:default: 10
.. envvar:: REACT_APP_MAX_SINGLE_FILE_SIZE
.. deprecated:: 0.3.0 now stored in database
Maximum size of a gpx or picture file.
:default: 1MB
.. envvar:: REACT_APP_MAX_ZIP_FILE_SIZE
.. deprecated:: 0.3.0 now stored in database
Maximum size of a zip archive.
:default: 10MB
.. envvar:: REACT_APP_ALLOW_REGISTRATION
.. deprecated:: 0.3.0 now stored in database
Allows users to register.
:default: true
.. envvar:: REACT_APP_THUNDERFOREST_API_KEY
.. deprecated:: 0.4.0 see `TILE_SERVER_URL <installation.html#envvar-TILE_SERVER_URL>`__
ThunderForest API key.
.. warning::
| Since FitTrackee 0.3.0, some applications parameters are now stored in database.
| Related environment variables are needed to initialize database when upgrading from version prior 0.3.0.
Emails
^^^^^^
.. versionadded:: 0.3.0
@ -409,7 +359,7 @@ Dev environment
- Create **.env** from example and update it
(see `Environment variables <installation.html#environment-variables>`__).
- Install Python virtualenv, React and all related packages and
- Install Python virtualenv, Vue and all related packages and
initialize the database:
.. code:: bash
@ -439,13 +389,13 @@ Production environment
.. warning::
| Note that FitTrackee is under heavy development, some features may be unstable.
- Download the last release (for now, it is the release v0.4.9):
- Download the last release (for now, it is the release v0.5.0):
.. code:: bash
$ wget https://github.com/SamR1/FitTrackee/archive/v0.4.9.tar.gz
$ tar -xzf v0.4.9.tar.gz
$ mv FitTrackee-0.4.9 FitTrackee
$ wget https://github.com/SamR1/FitTrackee/archive/v0.5.0.tar.gz
$ tar -xzf v0.5.0.tar.gz
$ mv FitTrackee-0.5.0 FitTrackee
$ cd FitTrackee
- Create **.env** from example and update it
@ -520,13 +470,13 @@ Prod environment
- Change to the directory where FitTrackee directory is located
- Download the last release (for now, it is the release v0.4.9) and overwrite existing files:
- Download the last release (for now, it is the release v0.5.0) and overwrite existing files:
.. code:: bash
$ wget https://github.com/SamR1/FitTrackee/archive/v0.4.9.tar.gz
$ tar -xzf v0.4.9.tar.gz
$ cp -R FitTrackee-0.4.9/* FitTrackee/
$ wget https://github.com/SamR1/FitTrackee/archive/v0.5.0.tar.gz
$ tar -xzf v0.5.0.tar.gz
$ cp -R FitTrackee-0.5.0/* FitTrackee/
$ cd FitTrackee
- Update **.env** if needed (see `Environment variables <installation.html#environment-variables>`__).
@ -704,19 +654,25 @@ Open http://localhost:8025 to access `MailHog interface <https://github.com/mail
$ make docker-shell
Client Development
^^^^^^^^^^^^^^^^^^
Development
^^^^^^^^^^^
.. versionadded:: 0.4.10
.. versionadded:: 0.5.0
- in order to start client with React dev tools, install `fittrackee_client`
- an additional step is to install `fittrackee_client`
.. code-block:: bash
$ make docker-build-client
- start React app
- to start **FitTrackee** with client dev tools:
.. code-block:: bash
$ make docker-serve-client
$ make docker-serve-client
Open http://localhost:3000 and log in (the email is ``admin@example.com``
and the password ``mpwoadmin``) or register
.. note::
Some environment variables need to be updated like `UI_URL`

View File

@ -144,18 +144,6 @@
<li><a href="installation.html#envvar-MAP_ATTRIBUTION">MAP_ATTRIBUTION</a>
</li>
<li><a href="installation.html#envvar-PORT">PORT</a>
</li>
<li><a href="installation.html#envvar-REACT_APP_ALLOW_REGISTRATION">REACT_APP_ALLOW_REGISTRATION</a>
</li>
<li><a href="installation.html#envvar-REACT_APP_API_URL">REACT_APP_API_URL</a>
</li>
<li><a href="installation.html#envvar-REACT_APP_GPX_LIMIT_IMPORT">REACT_APP_GPX_LIMIT_IMPORT</a>
</li>
<li><a href="installation.html#envvar-REACT_APP_MAX_SINGLE_FILE_SIZE">REACT_APP_MAX_SINGLE_FILE_SIZE</a>
</li>
<li><a href="installation.html#envvar-REACT_APP_MAX_ZIP_FILE_SIZE">REACT_APP_MAX_ZIP_FILE_SIZE</a>
</li>
<li><a href="installation.html#envvar-REACT_APP_THUNDERFOREST_API_KEY">REACT_APP_THUNDERFOREST_API_KEY</a>
</li>
<li><a href="installation.html#envvar-REDIS_URL">REDIS_URL</a>
</li>
@ -166,6 +154,8 @@
<li><a href="installation.html#envvar-UI_URL">UI_URL</a>
</li>
<li><a href="installation.html#envvar-UPLOAD_FOLDER">UPLOAD_FOLDER</a>
</li>
<li><a href="installation.html#envvar-VUE_APP_API_URL">VUE_APP_API_URL</a>
</li>
<li><a href="installation.html#envvar-WEATHER_API_KEY">WEATHER_API_KEY</a>
</li>

View File

@ -80,7 +80,6 @@
<li><a class="reference internal" href="#">Installation</a><ul>
<li><a class="reference internal" href="#prerequisites">Prerequisites</a></li>
<li><a class="reference internal" href="#environment-variables">Environment variables</a><ul>
<li><a class="reference internal" href="#deprecated-variables">Deprecated variables</a></li>
<li><a class="reference internal" href="#emails">Emails</a></li>
<li><a class="reference internal" href="#map-tile-server">Map tile server</a></li>
</ul>
@ -106,7 +105,7 @@
<li><a class="reference internal" href="#deployment">Deployment</a></li>
<li><a class="reference internal" href="#docker">Docker</a><ul>
<li><a class="reference internal" href="#id5">Installation</a></li>
<li><a class="reference internal" href="#client-development">Client Development</a></li>
<li><a class="reference internal" href="#development">Development</a></li>
</ul>
</li>
</ul>
@ -439,86 +438,11 @@ see <a class="reference external" href="https://docs.sqlalchemy.org/en/13/core/p
</dd></dl>
<dl class="std envvar">
<dt class="sig sig-object std" id="envvar-REACT_APP_API_URL">
<span class="sig-name descname"><span class="pre">REACT_APP_API_URL</span></span><a class="headerlink" href="#envvar-REACT_APP_API_URL" title="Permalink to this definition"></a></dt>
<dt class="sig sig-object std" id="envvar-VUE_APP_API_URL">
<span class="sig-name descname"><span class="pre">VUE_APP_API_URL</span></span><a class="headerlink" href="#envvar-VUE_APP_API_URL" title="Permalink to this definition"></a></dt>
<dd><p><strong>FitTrackee</strong> API URL, only needed in dev environment.</p>
</dd></dl>
<section id="deprecated-variables">
<h3>Deprecated variables<a class="headerlink" href="#deprecated-variables" title="Permalink to this headline"></a></h3>
<dl class="std envvar">
<dt class="sig sig-object std" id="envvar-REACT_APP_GPX_LIMIT_IMPORT">
<span class="sig-name descname"><span class="pre">REACT_APP_GPX_LIMIT_IMPORT</span></span><a class="headerlink" href="#envvar-REACT_APP_GPX_LIMIT_IMPORT" title="Permalink to this definition"></a></dt>
<dd><div class="deprecated">
<p><span class="versionmodified deprecated">Deprecated since version 0.3.0: </span>now stored in database</p>
</div>
<p>Maximum number of gpx file in zip archive.</p>
<dl class="field-list simple">
<dt class="field-odd">Default</dt>
<dd class="field-odd"><p>10</p>
</dd>
</dl>
</dd></dl>
<dl class="std envvar">
<dt class="sig sig-object std" id="envvar-REACT_APP_MAX_SINGLE_FILE_SIZE">
<span class="sig-name descname"><span class="pre">REACT_APP_MAX_SINGLE_FILE_SIZE</span></span><a class="headerlink" href="#envvar-REACT_APP_MAX_SINGLE_FILE_SIZE" title="Permalink to this definition"></a></dt>
<dd><div class="deprecated">
<p><span class="versionmodified deprecated">Deprecated since version 0.3.0: </span>now stored in database</p>
</div>
<p>Maximum size of a gpx or picture file.</p>
<dl class="field-list simple">
<dt class="field-odd">Default</dt>
<dd class="field-odd"><p>1MB</p>
</dd>
</dl>
</dd></dl>
<dl class="std envvar">
<dt class="sig sig-object std" id="envvar-REACT_APP_MAX_ZIP_FILE_SIZE">
<span class="sig-name descname"><span class="pre">REACT_APP_MAX_ZIP_FILE_SIZE</span></span><a class="headerlink" href="#envvar-REACT_APP_MAX_ZIP_FILE_SIZE" title="Permalink to this definition"></a></dt>
<dd><div class="deprecated">
<p><span class="versionmodified deprecated">Deprecated since version 0.3.0: </span>now stored in database</p>
</div>
<p>Maximum size of a zip archive.</p>
<dl class="field-list simple">
<dt class="field-odd">Default</dt>
<dd class="field-odd"><p>10MB</p>
</dd>
</dl>
</dd></dl>
<dl class="std envvar">
<dt class="sig sig-object std" id="envvar-REACT_APP_ALLOW_REGISTRATION">
<span class="sig-name descname"><span class="pre">REACT_APP_ALLOW_REGISTRATION</span></span><a class="headerlink" href="#envvar-REACT_APP_ALLOW_REGISTRATION" title="Permalink to this definition"></a></dt>
<dd><div class="deprecated">
<p><span class="versionmodified deprecated">Deprecated since version 0.3.0: </span>now stored in database</p>
</div>
<p>Allows users to register.</p>
<dl class="field-list simple">
<dt class="field-odd">Default</dt>
<dd class="field-odd"><p>true</p>
</dd>
</dl>
</dd></dl>
<dl class="std envvar">
<dt class="sig sig-object std" id="envvar-REACT_APP_THUNDERFOREST_API_KEY">
<span class="sig-name descname"><span class="pre">REACT_APP_THUNDERFOREST_API_KEY</span></span><a class="headerlink" href="#envvar-REACT_APP_THUNDERFOREST_API_KEY" title="Permalink to this definition"></a></dt>
<dd><div class="deprecated">
<p><span class="versionmodified deprecated">Deprecated since version 0.4.0: </span>see <a class="reference external" href="installation.html#envvar-TILE_SERVER_URL">TILE_SERVER_URL</a></p>
</div>
<p>ThunderForest API key.</p>
</dd></dl>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<div class="line-block">
<div class="line">Since FitTrackee 0.3.0, some applications parameters are now stored in database.</div>
<div class="line">Related environment variables are needed to initialize database when upgrading from version prior 0.3.0.</div>
</div>
</div>
</section>
<section id="emails">
<h3>Emails<a class="headerlink" href="#emails" title="Permalink to this headline"></a></h3>
<div class="versionadded">
@ -689,7 +613,7 @@ $ <span class="nb">cd</span> FitTrackee
<ul class="simple">
<li><p>Create <strong>.env</strong> from example and update it
(see <a class="reference external" href="installation.html#environment-variables">Environment variables</a>).</p></li>
<li><p>Install Python virtualenv, React and all related packages and
<li><p>Install Python virtualenv, Vue and all related packages and
initialize the database:</p></li>
</ul>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ make install-dev
@ -720,11 +644,11 @@ and the password <code class="docutils literal notranslate"><span class="pre">mp
</div>
</div>
<ul class="simple">
<li><p>Download the last release (for now, it is the release v0.4.9):</p></li>
<li><p>Download the last release (for now, it is the release v0.5.0):</p></li>
</ul>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ wget https://github.com/SamR1/FitTrackee/archive/v0.4.9.tar.gz
$ tar -xzf v0.4.9.tar.gz
$ mv FitTrackee-0.4.9 FitTrackee
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ wget https://github.com/SamR1/FitTrackee/archive/v0.5.0.tar.gz
$ tar -xzf v0.5.0.tar.gz
$ mv FitTrackee-0.5.0 FitTrackee
$ <span class="nb">cd</span> FitTrackee
</pre></div>
</div>
@ -798,11 +722,11 @@ $ make upgrade-db
<ul class="simple">
<li><p>Stop the application</p></li>
<li><p>Change to the directory where FitTrackee directory is located</p></li>
<li><p>Download the last release (for now, it is the release v0.4.9) and overwrite existing files:</p></li>
<li><p>Download the last release (for now, it is the release v0.5.0) and overwrite existing files:</p></li>
</ul>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ wget https://github.com/SamR1/FitTrackee/archive/v0.4.9.tar.gz
$ tar -xzf v0.4.9.tar.gz
$ cp -R FitTrackee-0.4.9/* FitTrackee/
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ wget https://github.com/SamR1/FitTrackee/archive/v0.5.0.tar.gz
$ tar -xzf v0.5.0.tar.gz
$ cp -R FitTrackee-0.5.0/* FitTrackee/
$ <span class="nb">cd</span> FitTrackee
</pre></div>
</div>
@ -976,23 +900,29 @@ $ make docker-build docker-run docker-init
</pre></div>
</div>
</section>
<section id="client-development">
<h3>Client Development<a class="headerlink" href="#client-development" title="Permalink to this headline"></a></h3>
<section id="development">
<h3>Development<a class="headerlink" href="#development" title="Permalink to this headline"></a></h3>
<div class="versionadded">
<p><span class="versionmodified added">New in version 0.4.10.</span></p>
<p><span class="versionmodified added">New in version 0.5.0.</span></p>
</div>
<ul class="simple">
<li><p>in order to start client with React dev tools, install <cite>fittrackee_client</cite></p></li>
<li><p>an additional step is to install <cite>fittrackee_client</cite></p></li>
</ul>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ make docker-build-client
</pre></div>
</div>
<ul class="simple">
<li><p>start React app</p></li>
<li><p>to start <strong>FitTrackee</strong> with client dev tools:</p></li>
</ul>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ make docker-serve-client
</pre></div>
</div>
<p>Open <a class="reference external" href="http://localhost:3000">http://localhost:3000</a> and log in (the email is <code class="docutils literal notranslate"><span class="pre">admin&#64;example.com</span></code>
and the password <code class="docutils literal notranslate"><span class="pre">mpwoadmin</span></code>) or register</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Some environment variables need to be updated like <cite>UI_URL</cite></p>
</div>
</section>
</section>
</section>

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -191,62 +191,12 @@ deployment method.
**Dark Sky** API key for weather data (not mandatory).
.. envvar:: REACT_APP_API_URL
.. envvar:: VUE_APP_API_URL
**FitTrackee** API URL, only needed in dev environment.
Deprecated variables
^^^^^^^^^^^^^^^^^^^^
.. envvar:: REACT_APP_GPX_LIMIT_IMPORT
.. deprecated:: 0.3.0 now stored in database
Maximum number of gpx file in zip archive.
:default: 10
.. envvar:: REACT_APP_MAX_SINGLE_FILE_SIZE
.. deprecated:: 0.3.0 now stored in database
Maximum size of a gpx or picture file.
:default: 1MB
.. envvar:: REACT_APP_MAX_ZIP_FILE_SIZE
.. deprecated:: 0.3.0 now stored in database
Maximum size of a zip archive.
:default: 10MB
.. envvar:: REACT_APP_ALLOW_REGISTRATION
.. deprecated:: 0.3.0 now stored in database
Allows users to register.
:default: true
.. envvar:: REACT_APP_THUNDERFOREST_API_KEY
.. deprecated:: 0.4.0 see `TILE_SERVER_URL <installation.html#envvar-TILE_SERVER_URL>`__
ThunderForest API key.
.. warning::
| Since FitTrackee 0.3.0, some applications parameters are now stored in database.
| Related environment variables are needed to initialize database when upgrading from version prior 0.3.0.
Emails
^^^^^^
.. versionadded:: 0.3.0
@ -409,7 +359,7 @@ Dev environment
- Create **.env** from example and update it
(see `Environment variables <installation.html#environment-variables>`__).
- Install Python virtualenv, React and all related packages and
- Install Python virtualenv, Vue and all related packages and
initialize the database:
.. code:: bash
@ -439,13 +389,13 @@ Production environment
.. warning::
| Note that FitTrackee is under heavy development, some features may be unstable.
- Download the last release (for now, it is the release v0.4.9):
- Download the last release (for now, it is the release v0.5.0):
.. code:: bash
$ wget https://github.com/SamR1/FitTrackee/archive/v0.4.9.tar.gz
$ tar -xzf v0.4.9.tar.gz
$ mv FitTrackee-0.4.9 FitTrackee
$ wget https://github.com/SamR1/FitTrackee/archive/v0.5.0.tar.gz
$ tar -xzf v0.5.0.tar.gz
$ mv FitTrackee-0.5.0 FitTrackee
$ cd FitTrackee
- Create **.env** from example and update it
@ -520,13 +470,13 @@ Prod environment
- Change to the directory where FitTrackee directory is located
- Download the last release (for now, it is the release v0.4.9) and overwrite existing files:
- Download the last release (for now, it is the release v0.5.0) and overwrite existing files:
.. code:: bash
$ wget https://github.com/SamR1/FitTrackee/archive/v0.4.9.tar.gz
$ tar -xzf v0.4.9.tar.gz
$ cp -R FitTrackee-0.4.9/* FitTrackee/
$ wget https://github.com/SamR1/FitTrackee/archive/v0.5.0.tar.gz
$ tar -xzf v0.5.0.tar.gz
$ cp -R FitTrackee-0.5.0/* FitTrackee/
$ cd FitTrackee
- Update **.env** if needed (see `Environment variables <installation.html#environment-variables>`__).
@ -704,19 +654,25 @@ Open http://localhost:8025 to access `MailHog interface <https://github.com/mail
$ make docker-shell
Client Development
^^^^^^^^^^^^^^^^^^
Development
^^^^^^^^^^^
.. versionadded:: 0.4.10
.. versionadded:: 0.5.0
- in order to start client with React dev tools, install `fittrackee_client`
- an additional step is to install `fittrackee_client`
.. code-block:: bash
$ make docker-build-client
- start React app
- to start **FitTrackee** with client dev tools:
.. code-block:: bash
$ make docker-serve-client
$ make docker-serve-client
Open http://localhost:3000 and log in (the email is ``admin@example.com``
and the password ``mpwoadmin``) or register
.. note::
Some environment variables need to be updated like `UI_URL`

View File

@ -1 +1,2 @@
VUE_APP_API_URL=http://localhost:5000
VUE_APP_API_URL=http://localhost:5000
PORT=3000

View File

@ -0,0 +1,24 @@
FROM node:16
MAINTAINER SamR1@users.noreply.github.com
# set working directory
RUN mkdir /usr/src/app
WORKDIR /usr/src/app
# add `/usr/src/app/node_modules/.bin` to $PATH
ENV PATH /usr/src/app/node_modules/.bin:$PATH
# add environment variables
ARG NODE_ENV
ARG VUE_APP_API_URL
ENV NODE_ENV $NODE_ENV
ENV VUE_APP_API_URL $VUE_APP_API_URL
# install dependencies
COPY package.json /usr/src/app/package.json
RUN yarn install --silent
RUN yarn global add @vue/cli
# copy source
COPY . /usr/src/app/