Skip to content

Commit

Permalink
docker update
Browse files Browse the repository at this point in the history
  • Loading branch information
arn-ob committed Apr 5, 2023
1 parent 616921d commit 6834a95
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
11 changes: 4 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
FROM node:16-alpine as builder
FROM node:16-alpine

# Set the working directory to /app inside the container
WORKDIR /app

# Copy app files
COPY . .

# Install dependencies (npm ci makes sure the exact versions in the lockfile gets installed)
RUN npm install

# Bundle static assets with nginx
FROM node:16-alpine as production

# Copy built assets from `builder` image
COPY . .

# Expose port
EXPOSE 4324
EXPOSE 4324

CMD ["npm", "start"]
10 changes: 10 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: '3'

services:
test-app:
container_name: test-apps
build:
context: .
dockerfile: Dockerfile
ports:
- 4324:4324
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "nodemon server.js"
"start": "node server.js"
},
"author": "",
"license": "ISC",
Expand Down

0 comments on commit 6834a95

Please sign in to comment.