Skip to content

Commit

Permalink
Small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanpoland committed Jul 26, 2024
1 parent c907a91 commit 9512206
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 9 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
npm-debug.log
Dockerfile
docker-compose.yml
.git
.gitignore
14 changes: 6 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ version: '3.8'

services:
app:
image: node:18
container_name: Horizon-Website
working_dir: /app
volumes:
- .:/app
command: >
sh -c "npm install && npm run build && npm run start"
build: .
container_name: horizon-website
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- NODE_ENV=production
volumes:
- .:/app
- /app/node_modules
23 changes: 23 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Use the official Node.js image.
FROM node:18

# Create and set the working directory.
WORKDIR /app

# Copy package.json and package-lock.json (or yarn.lock) first to leverage Docker cache.
COPY package*.json ./

# Install dependencies.
RUN npm install

# Copy the rest of the application files.
COPY . .

# Build the application.
RUN npm run build

# Expose the port the app runs on.
EXPOSE 3000

# Start the application.
CMD ["npm", "run", "start"]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"dev": "next dev -H 0.0.0.0 -p 2575",
"build": "next build && next export",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
Expand Down

0 comments on commit 9512206

Please sign in to comment.