Skip to content

Commit

Permalink
Merge pull request #316 from threefoldtech/mass_dep_nginx
Browse files Browse the repository at this point in the history
Mass dep nginx
  • Loading branch information
PeterNashaat authored Jan 14, 2025
2 parents 127e8bb + d9395c5 commit 4903a36
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tfgrid3/massdep_nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM ubuntu:24.04

RUN apt update && \
apt -y install wget openssh-server nginx

RUN wget -O /sbin/zinit https://github.com/threefoldtech/zinit/releases/download/v0.2.14/zinit && \
chmod +x /sbin/zinit

COPY zinit /etc/zinit
COPY start.sh /start.sh

RUN chmod +x /sbin/zinit && chmod +x /start.sh
ENTRYPOINT ["zinit", "init"]
19 changes: 19 additions & 0 deletions tfgrid3/massdep_nginx/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Development Guide for Mass_dep image

#### Image
image contains only ssh and nginx

### Pull the image
```bash
docker pull threefolddev/nginx-massdep
```

### Build the image
```bash
docker build -t threefolddev/nginx-massdep .
```

### RUN the image
```bash
sudo docker run -d --name <container_name> threefolddev/nginx-massdep
```
8 changes: 8 additions & 0 deletions tfgrid3/massdep_nginx/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
mkdir -p /var/run/sshd
mkdir -p /root/.ssh
touch /root/.ssh/authorized_keys

chmod 700 /root/.ssh
chmod 600 /root/.ssh/authorized_keys
echo "daemon off;" >> /etc/nginx/nginx.conf
1 change: 1 addition & 0 deletions tfgrid3/massdep_nginx/zinit/nginx.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exec: /usr/sbin/nginx -g 'daemon off;'
3 changes: 3 additions & 0 deletions tfgrid3/massdep_nginx/zinit/ssh-init.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
exec: /start.sh
log: stdout
oneshot: true
3 changes: 3 additions & 0 deletions tfgrid3/massdep_nginx/zinit/sshd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
exec: /usr/sbin/sshd -D
after:
- ssh-init

0 comments on commit 4903a36

Please sign in to comment.