Skip to content

Commit

Permalink
add docker compose profiles, for demo site
Browse files Browse the repository at this point in the history
  • Loading branch information
ug.rp committed Apr 20, 2024
1 parent 977f557 commit ea32542
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
13 changes: 9 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 14 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit ea32542

Please sign in to comment.