Skip to content

Instantly share code, notes, and snippets.

@JoseCage
Forked from paulredmond/Dockerfile
Created May 3, 2020 23:57
Show Gist options
  • Save JoseCage/5a0d056a4722ae109e3087f09733866d to your computer and use it in GitHub Desktop.
Save JoseCage/5a0d056a4722ae109e3087f09733866d to your computer and use it in GitHub Desktop.
A Dockerfile for a Laravel PHP Application with Caddy Server
FROM php:7.1-fpm
LABEL maintainer="Paul Redmond <paul@bitpress.io>"
# Install application dependencies
RUN curl --silent --show-error --fail --location \
--header "Accept: application/tar+gzip, application/x-gzip, application/octet-stream" -o - \
"https://caddyserver.com/download/linux/amd64?plugins=http.expires,http.realip&license=personal" \
| tar --no-same-owner -C /usr/bin/ -xz caddy \
&& chmod 0755 /usr/bin/caddy \
&& /usr/bin/caddy -version \
&& docker-php-ext-install mbstring pdo pdo_mysql
COPY . /srv/app
COPY docker/Caddyfile /etc/Caddyfile
WORKDIR /srv/app/
RUN chown -R www-data:www-data /srv/app
CMD ["/usr/bin/caddy", "--conf", "/etc/Caddyfile", "--log", "stdout"]
@prodev711
Copy link

prodev711 commented May 7, 2023

CMD ["/usr/bin/caddy", "--conf", "/etc/Caddyfile", "--log", "stdout"]
In this command, after install caddy server in Ubuntu 22.04 system, I can't caddy binary file in bin folder. I think there are some issues in installing, I can't find what is error.

I have this error 2023-05-07 02:26:31,842 INFO spawnerr: can't find command '/usr/local/bin/caddy'

I have installed with this way
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/testing/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-testing-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/testing/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-testing.list sudo apt update
sudo apt install caddy

How can I install caddy server in Ubuntu system correctly. please help me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment