diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..5b26a93 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +node_modules +debug.log +.git +.gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7f06070 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +node_modules +simpleledger.db +debug.log diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e73d8a2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +# Use an official Node.js runtime as a parent image +FROM node:18-alpine + +# Set the working directory in the container +WORKDIR /usr/src/app + +# Copy package.json and package-lock.json to the working directory +COPY package*.json ./ + +# Install app dependencies +RUN npm install + +# Copy the rest of the application files to the working directory +COPY . . + +# Make port 3000 available to the world outside this container +EXPOSE 3000 + +# Define the command to run your app +CMD [ "node", "server.js" ] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..214b0d2 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +services: + app: + build: . + ports: + - "3001:3000" + volumes: + - ./ledger_db:/usr/src/app/data + +volumes: + ledger_db: diff --git a/index.html b/index.html index c190f00..185496d 100644 --- a/index.html +++ b/index.html @@ -4,10 +4,9 @@