Skip to content

Commit 1d39e9c

Browse files
committed
Add node_js_containers.yml
1 parent 2cdba84 commit 1d39e9c

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Dockerized NodeJs App
2+
on: push
3+
4+
jobs:
5+
node-docker:
6+
runs-on: ubuntu-latest
7+
8+
# Instead of the 'container' key, specify 'services'
9+
services:
10+
# The following is very similar to a docker_compose.yml file
11+
app:
12+
# Specify the username/imagename on dockerhub.com
13+
build: alialaa17/node-api
14+
ports:
15+
- 3001:3000
16+
mongo:
17+
image: mongo
18+
ports:
19+
- "27017:27017"
20+
steps:
21+
- name: Post a user
22+
# Send a HTTP POST request to create a user to the mongo DB.
23+
run: "curl -X POST http://localhost:3001/api/user -H 'Content-Type: application: application/json' -d '{\"username\": \"hello\", \"address\": \"dwded\"}'"
24+
run: "curl -X POST http://localhost:3001/api/user -H 'Content-Type: application: application/json' -d '{\"username\": \"hello\", \"address\": \"pluk\"}'"
25+
- name: Get Users
26+
run: curl http://localhost:3001/api/users
27+
28+
29+
30+
31+

0 commit comments

Comments
 (0)