Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Use node:22-alpine image as base
FROM docker.io/node:22-alpine

# Set environment variable as development
ENV NODE_ENV=development

# Defining work directory
WORKDIR /usr/src/app

# Copy the packages from remote directory to container work directory
COPY --chown=1001:1001 package.json ./

# Install all dependacies using npm
RUN npm install

# Copy the application to container
COPY --chown=1001:1001 . /usr/src/app

# Expose the 3000 port to accept upcomming traffic
EXPOSE 3000

# Execute the start script
CMD ["npm", "start"]
26 changes: 24 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ no-as-service/
├── index.js # Express API
├── reasons.json # 1000+ universal rejection reasons
├── package.json
├── .devcontainer.json # VS Code / Github devcontainer setup
└── README.md
├── README.md
├── Containerfile
└── .devcontainer.json # VS Code / Github devcontainer setup
```

---
Expand Down Expand Up @@ -119,6 +120,27 @@ For reference, here’s the package config:

---

## 🫙 Containerfile

### How to Build

podman / docker - use the same arguments, replace podman with docker if needed.
```bash
cd no-as-a-service
podman build -t your-image-name -f Containerfile
```

### How to Use

podman / docker - use the same arguments, replace podman with docker if needed.

If desired, change the host port, which is the first port listed below. eg; To use local port 4000 change the argument to -p 4000:3000, which maps your host port 4000 to the container port 3000

```bash
podman run -d -p 3000:3000 your-image-name
```

---
## ⚓ Devcontainer

If you open this repo in Github Codespaces, it will automatically use `.devcontainer.json` to set up your environment. If you open it in VSCode, it will ask you if you want to reopen it in a container.
Expand Down