Skip to content

Commit 31beb1b

Browse files
author
Juan Luna
committed
Add docker files to create a development environment container
1 parent 861be24 commit 31beb1b

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed

.dockerignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Ignore runtime and log files
2+
pids
3+
logs
4+
npm-debug.log
5+
6+
# Ignore Node.js modules
7+
node_modules
8+
9+
# Ignore test coverage and other temporary data
10+
coverage/
11+
run
12+
.nyc_output
13+
.basement
14+
basement_dist
15+
16+
# Ignore system-specific files
17+
.DS_Store
18+
19+
# Ignore VuePress temporary files
20+
.vuepress/.cache
21+
.vuepress/.temp
22+
23+
# Ignore configuration files specific to local development
24+
config.local.js
25+
26+
# Ignore non-standard lock files
27+
yarn*.lock
28+
!yarn.lock

Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Base node image to run this version of the documentation site
2+
FROM node:18.20.2
3+
4+
# Set the working directory inside the container
5+
WORKDIR /app
6+
7+
# Copy only the package.json and yarn.lock files to install dependencies
8+
COPY package.json yarn.lock ./
9+
10+
# Install dependencies
11+
RUN yarn install
12+
13+
# Copy the rest of the application code
14+
COPY . .
15+
16+
# Expose the default VuePress dev server port
17+
EXPOSE 8080
18+
19+
# Start the VuePress dev server
20+
CMD ["yarn", "dev"]

docker-compose.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
services:
2+
vuepress:
3+
build:
4+
context: . # The directory containing your Dockerfile
5+
dockerfile: Dockerfile # Explicitly specify the Dockerfile
6+
ports:
7+
- "8080:8080" # Map port 8080 on the host to 8080 in the container
8+
volumes:
9+
- .:/app # Mount the current directory to /app in the container
10+
- /app/node_modules # Exclude node_modules from the host to avoid conflicts
11+
environment:
12+
- NODE_ENV=development # Set the environment variable
13+
command: yarn dev # Run the development server when the container starts

0 commit comments

Comments
 (0)