Skip to content

Commit d00527d

Browse files
committed
Added Containerfile
Added -f so docker builds work as expected. Cleared up container image usage.
1 parent 7cfa9d2 commit d00527d

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

Containerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Use node:22-alpine image as base
2+
FROM docker.io/node:22-alpine
3+
4+
# Set environment variable as development
5+
ENV NODE_ENV=development
6+
7+
# Defining work directory
8+
WORKDIR /usr/src/app
9+
10+
# Copy the packages from remote directory to container work directory
11+
COPY --chown=1001:1001 package.json ./
12+
13+
# Install all dependacies using npm
14+
RUN npm install
15+
16+
# Copy the application to container
17+
COPY --chown=1001:1001 . /usr/src/app
18+
19+
# Expose the 3000 port to accept upcomming traffic
20+
EXPOSE 3000
21+
22+
# Execute the start script
23+
CMD ["npm", "start"]

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ no-as-service/
9090
├── reasons.json # 1000+ universal rejection reasons
9191
├── package.json
9292
└── README.md
93+
└── Containerfile
9394
```
9495

9596
---
@@ -118,6 +119,28 @@ For reference, here’s the package config:
118119

119120
---
120121

122+
## 🫙 Containerfile
123+
124+
### How to Build
125+
126+
podman / docker - use the same arguments, replace podman with docker if needed.
127+
```bash
128+
cd no-as-a-service
129+
podman build -t your-image-name -f Containerfile
130+
```
131+
132+
### How to Use
133+
134+
podman / docker - use the same arguments, replace podman with docker if needed.
135+
136+
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
137+
138+
```bash
139+
podman run -d -p 3000:3000 your-image-name
140+
```
141+
142+
---
143+
121144
## 👤 Author
122145

123146
Created with creative stubbornness by [hotheadhacker](https://github.com/hotheadhacker)

0 commit comments

Comments
 (0)