diff --git a/Dockerfile b/Dockerfile index 50ad781..9bc3364 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,15 +6,20 @@ WORKDIR /app # Copy application logic to the container COPY package*.json ./ -COPY index.html ./ + +# Install dependencies +RUN npm install + +# Copy rest of config files COPY poi.config.js ./ +# Copy index.html and demo/index.html files +COPY index.html ./index.html +COPY demo/index.html ./demo/index.html + # shadowed as volumes by compose COPY src ./src/ -# Install dependencies -RUN npm install - # Expose the port on which the frontend server runs EXPOSE 4002 diff --git a/README.md b/README.md index b5db078..e410ffd 100644 --- a/README.md +++ b/README.md @@ -249,6 +249,14 @@ Run `docker-compose up` to start a local server and `down` to stop it; `build` will re-build a new images for changes made outside of the `src` folder. +Profiles can be `dev` (for src work) or `demo` for the website/iframe +(src from cdn). + +```bash +docker-compose --profile dev up +docker-compose --profile demo up +``` + See `docker-compose.yml` and `Dockerfile`. With docker compose, the folder `./src` is mounted as a volume, to the container is used diff --git a/docker-compose.yml b/docker-compose.yml index aa12f06..252d3ec 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,12 +2,24 @@ version: "3.8" services: frontend: + profiles: ["dev"] build: context: . dockerfile: Dockerfile - container_name: radio4000-player-vue - hostname: radio4000-player-vue + container_name: radio4000-player-dev ports: - "4000:4002" volumes: - ./src:/app/src + - ./index.html:/app/index.html + demo: + profiles: ["demo"] + build: + context: . + dockerfile: Dockerfile + container_name: radio4000-player-demo + ports: + - "4003:4002" + volumes: + - ./src:/app/src + - ./demo/index.html:/app/index.html