Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker container keeps exiting on a Le Potato running Ubuntu Server #39

Open
gismc123 opened this issue Nov 27, 2023 · 1 comment
Open

Comments

@gismc123
Copy link

Hi Everyone,

I am really excited to build this on my home server. I run a home server on a Le Potato AML S905X-CC. I currently have Ubuntu server running on this SBC. I have tried to install this on my homeserver but I keep getting issues. The current issue I am facing is that the docker container keeps exiting when started. I am not sure what I am doing wrong.

Below are the steps I have done.

Step 1: Clone the Repository

git clone https://github.com/juriansluiman/groceri.es
cd groceri.es

Step 2: Build the Docker Image

Create a backup copy of the Dockerfile and update the Dockerfile

cp Dockerfile Dockerfile.bk
nano Dockerfile

Use an ARM-compatible base image instead of the x86_64 image:

# Dockerfile
FROM arm32v7/python:3.8-alpine

# Rest of your Dockerfile remains unchanged

Build the Docker image:

docker build -t groceri.es .

Step 3: Set Up Docker Volumes

For Database

docker volume create groceries-db
docker run -d --name groceri.es -v groceries-db:/app/db -e SECRET_KEY='my-secret-here' -p 1012:80 groceri.es

For Image Uploads

docker volume create groceries-uploads
docker run -d --name groceri.es_second -v groceries-db:/app/db -v groceries-uploads:/app/uploads -e SECRET_KEY='my-secret-here' -p 1012:80 groceri.es

Step 4: Run the Container

docker run -d --name groceri.es_app -p 1012:80 -e SECRET_KEY='my-secret-here' groceri.es

After completing these steps, I should be able to access the groceri.es application by navigating to http://192.168.1.94:1012 in my web browser. However, the container keeps exiting and when I navigate to the webpage, I get a this site can't be reached error.

Can you please help, I am not sure what to do to fix this. Or will it not work on a SBC?

@gismc123
Copy link
Author

Below is a copy of commands in terminal. Not sure if it helps.

gismc@ubuntu-22:~$ git clone https://github.com/juriansluiman/groceri.es
cd groceri.es
Cloning into 'groceri.es'...
remote: Enumerating objects: 476, done.
remote: Counting objects: 100% (92/92), done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 476 (delta 83), reused 79 (delta 79), pack-reused 384
Receiving objects: 100% (476/476), 828.95 KiB | 5.25 MiB/s, done.
Resolving deltas: 100% (308/308), done.
gismc@ubuntu-22:~/groceri.es$ cp Dockerfile Dockerfile.bk
gismc@ubuntu-22:~/groceri.es$ nano Dockerfile
gismc@ubuntu-22:~/groceri.es$ docker build -t groceri.es .
[+] Building 1.3s (11/11) FINISHED                                                                                                 docker:default
 => [internal] load build definition from Dockerfile                                                                                         0.1s
 => => transferring dockerfile: 281B                                                                                                         0.0s
 => [internal] load .dockerignore                                                                                                            0.1s
 => => transferring context: 63B                                                                                                             0.0s
 => [internal] load metadata for docker.io/arm32v7/python:3.8-alpine                                                                         0.7s
 => [1/6] FROM docker.io/arm32v7/python:3.8-alpine@sha256:0ee492d95ac596738a1cc0061c458dbd495b2050df6603f9fce84f68a0c872e8                   0.0s
 => [internal] load build context                                                                                                            0.1s
 => => transferring context: 111.54kB                                                                                                        0.1s
 => CACHED [2/6] RUN pip install --upgrade pip                                                                                               0.0s
 => CACHED [3/6] RUN apk add py-cryptography                                                                                                 0.0s
 => CACHED [4/6] COPY ./app/requirements.txt /app/                                                                                           0.0s
 => CACHED [5/6] RUN pip install -r /app/requirements.txt                                                                                    0.0s
 => CACHED [6/6] COPY ./app /app                                                                                                             0.0s
 => exporting to image                                                                                                                       0.0s
 => => exporting layers                                                                                                                      0.0s
 => => writing image sha256:4b4d71274c41aa5562e0f434807f97cfff0167760b1a84ab691a6e48d6541b93                                                 0.0s
 => => naming to docker.io/library/groceri.es                                                                                                0.0s
gismc@ubuntu-22:~/groceri.es$ docker volume create groceries-db
docker run -d --name groceri.es -v groceries-db:/app/db -e SECRET_KEY='my-secret-here' -p 1012:80 groceri.es
groceries-db
8dc3ea9fed011bb0ddc0fc94c2b378c07cc288a0bd2241bf5469c59e2b452bf7
gismc@ubuntu-22:~/groceri.es$ docker volume create groceries-uploads
docker run -d --name groceri.es_second -v groceries-db:/app/db -v groceries-uploads:/app/uploads -e SECRET_KEY='my-secret-here' -p 1012:80 groceri.es
groceries-uploads
5f1482b782d610a6313097edf7057fe8ca394a1b66158862fcc48aaaac656f18
gismc@ubuntu-22:~/groceri.es$ docker run -d --name groceri.es -p 1012:80 -e SECRET_KEY='my-secret-here' groceri.es
docker: Error response from daemon: Conflict. The container name "/groceri.es" is already in use by container "8dc3ea9fed011bb0ddc0fc94c2b378c07cc288a0bd2241bf5469c59e2b452bf7". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.
gismc@ubuntu-22:~/groceri.es$ docker run -d --name groceri.es_app -p 1012:80 -e SECRET_KEY='my-secret-here' groceri.es
bb0331b1fbaa7715f9ecaa05ed2e87d7099b5125898bfb45c6d4a732cc283fde
gismc@ubuntu-22:~/groceri.es$ docker ps -l
CONTAINER ID   IMAGE        COMMAND     CREATED          STATUS                      PORTS     NAMES
bb0331b1fbaa   groceri.es   "python3"   31 seconds ago   Exited (0) 29 seconds ago             groceri.es_app

@gismc123 gismc123 changed the title Need Help to install it on a Le Potato running Ubuntu Server Docker container keeps exiting on a Le Potato running Ubuntu Server Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant