kailashhh commited on
Commit
e6ebf4d
·
verified ·
1 Parent(s): e547bf9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +27 -55
Dockerfile CHANGED
@@ -1,62 +1,34 @@
1
- # Use Ubuntu 22.04 as the base image
2
  FROM ubuntu:22.04
3
 
4
- # Set environment variables for non-interactive installation
5
- ENV DEBIAN_FRONTEND=noninteractive
 
6
 
7
- # Update and install necessary packages
8
- RUN apt-get update && apt-get install -y \
9
- apt-utils \
10
  curl \
11
- bash \
12
  ca-certificates \
13
- gnupg \
14
- openssh-client \
15
- openssh-server \
16
- docker.io \
17
  && rm -rf /var/lib/apt/lists/*
18
 
19
- # Create necessary directories for Coolify and set the correct ownership and permissions
20
- RUN mkdir -p /data/coolify/{source,ssh,applications,databases,backups,services,proxy,webhooks-during-maintenance} \
21
- && mkdir -p /data/coolify/ssh/{keys,mux} \
22
- && mkdir -p /data/coolify/proxy/dynamic
23
-
24
- # Create a non-root user
25
- RUN useradd -ms /bin/bash coolifyuser \
26
- && mkdir -p /home/coolifyuser/.ssh \
27
- && chown -R coolifyuser:coolifyuser /data/coolify /home/coolifyuser
28
-
29
- # Switch to the non-root user for the following operations
30
- USER coolifyuser
31
-
32
- # Generate SSH key (as coolifyuser)
33
- #RUN ssh-keygen -f /data/coolify/ssh/keys/id.root@host.docker.internal -t ed25519 -N '' -C root@coolify \
34
- # && cat /data/coolify/ssh/keys/id.root@host.docker.internal.pub >>~/.ssh/authorized_keys \
35
- # && chmod 600 ~/.ssh/authorized_keys
36
-
37
- # Download Coolify resources and ensure write permissions (as coolifyuser)
38
- RUN curl -fsSL https://cdn.coollabs.io/coolify/docker-compose.yml -o /data/coolify/source/docker-compose.yml \
39
- && curl -fsSL https://cdn.coollabs.io/coolify/docker-compose.prod.yml -o /data/coolify/source/docker-compose.prod.yml \
40
- && curl -fsSL https://cdn.coollabs.io/coolify/.env.production -o /data/coolify/source/.env \
41
- && curl -fsSL https://cdn.coollabs.io/coolify/upgrade.sh -o /data/coolify/source/upgrade.sh
42
-
43
- # Change ownership of files (to ensure everything is accessible by coolifyuser)
44
- RUN chown -R coolifyuser:coolifyuser /data/coolify
45
-
46
- # Switch back to root to perform Docker setup
47
- USER root
48
-
49
- # Modify the environment file with dynamic values
50
- RUN sed -i "s|APP_ID=.*|APP_ID=$(openssl rand -hex 16)|g" /data/coolify/source/.env \
51
- && sed -i "s|APP_KEY=.*|APP_KEY=base64:$(openssl rand -base64 32)|g" /data/coolify/source/.env \
52
- && sed -i "s|DB_PASSWORD=.*|DB_PASSWORD=$(openssl rand -base64 32)|g" /data/coolify/source/.env \
53
- && sed -i "s|REDIS_PASSWORD=.*|REDIS_PASSWORD=$(openssl rand -base64 32)|g" /data/coolify/source/.env \
54
- && sed -i "s|PUSHER_APP_ID=.*|PUSHER_APP_ID=$(openssl rand -hex 32)|g" /data/coolify/source/.env \
55
- && sed -i "s|PUSHER_APP_KEY=.*|PUSHER_APP_KEY=$(openssl rand -hex 32)|g" /data/coolify/source/.env \
56
- && sed -i "s|PUSHER_APP_SECRET=.*|PUSHER_APP_SECRET=$(openssl rand -hex 32)|g" /data/coolify/source/.env
57
-
58
- # Create Docker network
59
- RUN docker network create --attachable coolify
60
-
61
- # Start Coolify using Docker Compose
62
- CMD ["bash", "-c", "docker compose --env-file /data/coolify/source/.env -f /data/coolify/source/docker-compose.yml -f /data/coolify/source/docker-compose.prod.yml up -d --pull always --remove-orphans --force-recreate"]
 
1
+ # Use an official base image
2
  FROM ubuntu:22.04
3
 
4
+ # Set environment variables
5
+ ENV ADMIN_EMAIL=alex.c992954@gmail.com
6
+ ENV ADMIN_PASSWORD=admin
7
 
8
+ # Install dependencies
9
+ RUN apt-get update && \
10
+ apt-get install -y \
11
  curl \
 
12
  ca-certificates \
 
 
 
 
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
+ # Install Docker to access Docker Socket
16
+ RUN curl -fsSL https://get.docker.com -o get-docker.sh && \
17
+ sh get-docker.sh
18
+
19
+ # Create necessary directories and set up SSH key directory
20
+ RUN mkdir -p /seelf/data /root/.ssh && \
21
+ chmod 700 /seelf/data /root/.ssh
22
+
23
+ # Expose the port
24
+ EXPOSE 8080
25
+
26
+ # Set entry point and command to run the containerized app
27
+ CMD ["docker", "run", "-d", \
28
+ "-e", "ADMIN_EMAIL=${ADMIN_EMAIL}", \
29
+ "-e", "ADMIN_PASSWORD=${ADMIN_PASSWORD}", \
30
+ "-v", "/var/run/docker.sock:/var/run/docker.sock", \
31
+ "-v", "seelfdata:/seelf/data", \
32
+ "-v", "seelfssh:/root/.ssh", \
33
+ "-p", "8080:8080", \
34
+ "yuukanoo/seelf"]