Skip to content

Commit

Permalink
Merge pull request #199 from internet4000/feat/docker-compose
Browse files Browse the repository at this point in the history
add docker and docker-compose files to use node.js 16 (hard dep)
  • Loading branch information
4www committed Apr 20, 2024
2 parents fd62436 + 3350ef0 commit 977f557
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Use node image as base
FROM node:16

# Set working directory in the container
WORKDIR /app

# Copy application logic to the container
COPY package*.json ./
COPY index.html ./
COPY poi.config.js ./

# shadowed as volumes by compose
COPY src ./src/

# Install dependencies
RUN npm install

# Expose the port on which the frontend server runs
EXPOSE 4002

# Command to start the development server
CMD ["npm", "run", "start"]
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,3 +244,16 @@ Running this command create a new, tagged "release" commit including a productio

The `./demo/index.html` file will be deployed to player.radio4000.com via Netlify.

### With docker and doker-compose
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.

See `docker-compose.yml` and `Dockerfile`.

With docker compose, the folder `./src` is mounted as a volume, to the container is used
only for the node version 16 required by the project, and changes
should be reflected in the live server.

With solely docker, re-build for every change, and re-run the image to
see them on local server (run inside docker).
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: "3.8"

services:
frontend:
build:
context: .
dockerfile: Dockerfile
container_name: radio4000-player-vue
hostname: radio4000-player-vue
ports:
- "4000:4002"
volumes:
- ./src:/app/src
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"@vue/test-utils": "^1.0.0-beta.29",
"cypress": "^6.5.0",
"poi": "^12.10.3",
"webpack": "^4.0.0",
"release-it": "^14.12.5",
"start-server-and-test": "^1.9.1",
"vue-template-compiler": "^2.6.10"
Expand Down

0 comments on commit 977f557

Please sign in to comment.