Skip to content

Commit

Permalink
dockerized fragments app
Browse files Browse the repository at this point in the history
  • Loading branch information
marythedev committed Oct 14, 2023
1 parent 640e08d commit 05206b6
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.github/
.ssh/
.vscode/
coverage/
node_modules/
tests/
!tests/.htpasswd
.env
.eslintrc.js
.git/
.gitignore
.prettier*
jest*
37 changes: 37 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#Docker instructions necessary for Docker Engine to build the image
FROM node:18.17.0

LABEL maintainer="Maria Dmytrenko"
LABEL description="Fragments node.js microservice"

# We default to use port 8080 in our service
ENV PORT=8080

# Reduce npm spam when installing within Docker
# https://docs.npmjs.com/cli/v8/using-npm/config#loglevel
ENV NPM_CONFIG_LOGLEVEL=warn

# Disable colour when run inside Docker
# https://docs.npmjs.com/cli/v8/using-npm/config#color
ENV NPM_CONFIG_COLOR=false

# Use /app as our working directory
WORKDIR /app

# Copies the package.json and package-lock.json files into the working dir (./app)
COPY package.json package-lock.json ./

# Install node dependencies defined in package-lock.json
RUN npm install

# Copy src to /app/src/
COPY ./src ./src

# Copy our HTPASSWD file
COPY ./tests/.htpasswd ./tests/.htpasswd

# Start the container by running our server
CMD npm start

# Run service on port 8080
EXPOSE 8080

0 comments on commit 05206b6

Please sign in to comment.