From 4ff61cf7361f33b091be00a245530dc1dec9346a Mon Sep 17 00:00:00 2001 From: RoiArthurB Date: Fri, 11 Oct 2024 17:21:44 +0700 Subject: [PATCH] feat: Add development Dockerfile Related #21 --- .dockerignore | 44 ++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 22 ++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a5f313f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,44 @@ +# Node modules +node_modules +dist + +# Testing +coverage +.nyc_output + +# Logs +logs +*.log + +# Cache +.cache + +# IDE and editor files +.idea +.vscode +*.iml + +# Git-related files +.git +.gitignore + +# npm/yarn/pnpm cache and lockfiles (optional, uncomment if used) +.npm +# .yarn +# yarn.lock +# pnpm-lock.yaml + +# Operating system files +.DS_Store +Thumbs.db + +# Configuration files +.env + +# Other temporary files +*.swp +*.swo +*~ + +# SIMPLE exclusive +learning-packages \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4a7378f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +# Use a Node base image +FROM node:22-alpine + +# Set the working directory in the container +WORKDIR /app + +# Copy React app +COPY . . + +# Debug line as env file isn't supported yet... +RUN find /app/src -type f -exec sed -i "s/localhost/0\.0\.0\.0/g" "{}" \; + +# Install dependencies +RUN npm install + +# Expose the port your app runs on +EXPOSE 8000 +EXPOSE 8001 +EXPOSE 8080 + +# Start the application +CMD ["npm", "start"]