AndrewPaglusch / FlashPaper

One-time encrypted password/secret sharing
MIT License
374 stars 60 forks source link

Add arm dockerfile and update README #99

Closed yebo29 closed 1 year ago

yebo29 commented 1 year ago

I needed to run it on my Raspberry Pi, so I created a new Dockerfile that uses the ARM version of the alpine image. I also had to learn how to properly build it, so I added it to the readme.

Alternatively, a new ARM docker image could be created with the arm64v8 tag and uploaded to docker hub and then all the user would have to do is modify their docker-compose file to pull that image instead. README would reflect that. If that route is taken then this PR can be closed.

AndrewPaglusch commented 1 year ago

Thank you for the PR! I plan on reviewing this with the rest of the team this Friday.

AndrewPaglusch commented 1 year ago

@yebo29 Do you think you will be able to make the corrections I listed on October 28th?

yebo29 commented 1 year ago

I will be completely honest with you ... I am just now seeing this. I am so very sorry!! Yes I can make the requested changes. I will work on this tomorrow. I truly apologize for not seeing this.

yebo29 commented 1 year ago

I'll be testing the alpine image soon. README has been updated.

AndrewPaglusch commented 1 year ago

@yebo29 Do you still have more work or testing to do, or is this PR ready for our review?

yebo29 commented 1 year ago

@AndrewPaglusch I see you marked the comment on the Dockerfile as resolved, so yes, this is ready for review!

yebo29 commented 1 year ago

I have this running successfully on my Raspberry Pi 4 at home.

yebo29 commented 1 year ago

@mattburchett Roger. I'll work on implementing those changes.

yebo29 commented 1 year ago

@mattburchett I've uploaded the changes but have not tested them. I will do so at some point today.

yebo29 commented 1 year ago

Sorry; a little delayed. Testing now.

yebo29 commented 1 year ago

Tested successfully:

docker-compose build
Building flashpaper
Step 1/13 : FROM arm64v8/alpine:3.17.2
3.17.2: Pulling from arm64v8/alpine
af6eaf76a39c: Already exists
Digest: sha256:c41ab5c992deb4fe7e5da09f67a8804a46bd0592bfdf0b1847dde0e0889d2bff
Status: Downloaded newer image for arm64v8/alpine:3.17.2
 ---> d74e625d9115
Step 2/13 : ENV PHP_VER=php81
 ---> Running in 45a5350b483f
Removing intermediate container 45a5350b483f
 ---> d69dc4b3934a
Step 3/13 : ENV PHPFPM_VER=php-fpm81
 ---> Running in d952a4ff4738
Removing intermediate container d952a4ff4738
 ---> 863b5a6e6a69
Step 4/13 : RUN apk add --no-cache gettext curl nginx $PHP_VER $PHP_VER-fpm $PHP_VER-opcache $PHP_VER-pdo $PHP_VER-pdo_sqlite $PHP_VER-openssl &&     mkdir /var/www/html
 ---> Running in fb1d05febd6a
fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/main/aarch64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/community/aarch64/APKINDEX.tar.gz
(1/28) Installing ca-certificates (20220614-r4)
(2/28) Installing brotli-libs (1.0.9-r9)
(3/28) Installing nghttp2-libs (1.51.0-r0)
(4/28) Installing libcurl (8.0.1-r0)
(5/28) Installing curl (8.0.1-r0)
(6/28) Installing libgomp (12.2.1_git20220924-r4)
(7/28) Installing libintl (0.21.1-r1)
(8/28) Installing ncurses-terminfo-base (6.3_p20221119-r0)
(9/28) Installing ncurses-libs (6.3_p20221119-r0)
(10/28) Installing libunistring (1.1-r0)
(11/28) Installing gettext-libs (0.21.1-r1)
(12/28) Installing xz-libs (5.2.9-r0)
(13/28) Installing libxml2 (2.10.4-r0)
(14/28) Installing gettext (0.21.1-r1)
(15/28) Installing pcre (8.45-r2)
(16/28) Installing nginx (1.22.1-r0)
Executing nginx-1.22.1-r0.pre-install
Executing nginx-1.22.1-r0.post-install
(17/28) Installing php81-common (8.1.18-r0)
(18/28) Installing argon2-libs (20190702-r2)
(19/28) Installing libedit (20221030.3.1-r0)
(20/28) Installing pcre2 (10.42-r0)
(21/28) Installing php81 (8.1.18-r0)
(22/28) Installing libacl (2.3.1-r1)
(23/28) Installing php81-fpm (8.1.18-r0)
(24/28) Installing php81-opcache (8.1.18-r0)
(25/28) Installing php81-openssl (8.1.18-r0)
(26/28) Installing php81-pdo (8.1.18-r0)
(27/28) Installing sqlite-libs (3.40.1-r0)
(28/28) Installing php81-pdo_sqlite (8.1.18-r0)
Executing busybox-1.35.0-r29.trigger
Executing ca-certificates-20220614-r4.trigger
OK: 35 MiB in 43 packages
Removing intermediate container fb1d05febd6a
 ---> 10cff458f0e8
Step 5/13 : COPY . /var/www/html
 ---> 206b31157268
Step 6/13 : RUN chmod -R 775 /var/www/html &&     chown -R nginx:nginx /var/www/html
 ---> Running in a7464b24e647
Removing intermediate container a7464b24e647
 ---> 9fd3551f5e88
Step 7/13 : COPY docker/php-fpm.conf /etc/$PHP_VER/php-fpm.conf
 ---> a0cecb666814
Step 8/13 : COPY docker/nginx.conf /etc/nginx/nginx.conf
 ---> 7a8ef62013bb
Step 9/13 : COPY docker/entrypoint.sh /entrypoint.sh
 ---> 80bcab3b210a
Step 10/13 : RUN mkdir -p /var/run/nginx &&     mkdir -p /var/run/php-fpm &&     chown -R nginx:nginx /var/run/ &&     chmod +x /entrypoint.sh
 ---> Running in c0470e225b2a
Removing intermediate container c0470e225b2a
 ---> f712ff2d6dfd
Step 11/13 : VOLUME /var/www/html/data
 ---> Running in f81688d6cd8c
Removing intermediate container f81688d6cd8c
 ---> c1731e09a595
Step 12/13 : HEALTHCHECK --interval=30s --timeout=10s --retries=3 --start-period=10s     CMD curl -fSs 127.0.0.1:80/healthz || exit 1
 ---> Running in 88bc65081aa3
Removing intermediate container 88bc65081aa3
 ---> ff747ee8695f
Step 13/13 : ENTRYPOINT ["/bin/ash", "/entrypoint.sh"]
 ---> Running in 03e2519591f5
Removing intermediate container 03e2519591f5
 ---> 2be84d780ddd

Successfully built 2be84d780ddd
Successfully tagged flashpaper_flashpaper:latest
pi@Pi4Main:~/bin/docker-servers/FlashPaper $ dcufl 
Recreating flashpaper ... done
Attaching to flashpaper
flashpaper    | Checking to see if FlashPaper is ready. (1 of 3)
flashpaper    | FlashPaper is ready.
flashpaper    | Access logging is disabled for production use. Tailing error logs...
flashpaper    | ==> /var/log/nginx/error.log <==
flashpaper    | 
flashpaper    | ==> /var/log/php81/error.log <==
flashpaper    | [28-Apr-2023 15:19:30] NOTICE: fpm is running, pid 12
flashpaper    | [28-Apr-2023 15:19:30] NOTICE: ready to handle connections

dcufl is an alias in my shell for docker-compose up -d && docker-compose logs --follow I also added a variable to make updates easier. It can be removed if you prefer. I have other updates that I can submit in a separate PR.

yebo29 commented 1 year ago

@AndrewPaglusch @mattburchett anything else I need to do for this guy?