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

Rebase to 3.20 #70

Merged
merged 4 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 19 additions & 27 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.17
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.20

# set version label
ARG BUILD_DATE
Expand All @@ -10,35 +10,26 @@ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DA
LABEL maintainer="TheLamer"

RUN \
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies \
composer && \
echo "**** install runtime packages ****" && \
apk add --no-cache \
libxml2 \
mariadb-client \
php81-bcmath \
php81-ctype \
php81-curl \
php81-exif \
php81-gd \
php81-iconv \
php81-ldap \
php81-pdo_mysql \
php81-pdo_sqlite \
php81-pecl-redis \
php81-phar \
php81-sodium \
php81-sqlite3 \
php81-tokenizer \
php81-xmlreader \
php81-zip && \
apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \
php81-pecl-mcrypt && \
php83-bcmath \
php83-exif \
php83-gd \
php83-ldap \
php83-pdo_mysql \
php83-pdo_sqlite \
php83-pecl-redis \
php83-sodium \
php83-sqlite3 \
php83-tokenizer \
php83-xmlreader \
php83-pecl-mcrypt && \
echo "**** configure php-fpm to pass env vars ****" && \
sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php81/php-fpm.d/www.conf && \
grep -qxF 'clear_env = no' /etc/php81/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php81/php-fpm.d/www.conf && \
echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php81/php-fpm.conf && \
sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php83/php-fpm.d/www.conf && \
grep -qxF 'clear_env = no' /etc/php83/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php83/php-fpm.d/www.conf && \
echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php83/php-fpm.conf && \
echo "**** install snipe-it ****" && \
mkdir -p \
/app/www/ && \
Expand All @@ -59,10 +50,10 @@ RUN \
"/app/www/storage" \
"/app/www/public/uploads" \
/defaults/ && \
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies && \
rm -rf \
$HOME/.cache \
$HOME/.composer \
/tmp/*

Expand All @@ -71,4 +62,5 @@ COPY root/ /

# ports and volumes
EXPOSE 80 443

VOLUME /config
46 changes: 19 additions & 27 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.17
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.20

# set version label
ARG BUILD_DATE
Expand All @@ -10,35 +10,26 @@ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DA
LABEL maintainer="TheLamer"

RUN \
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies \
composer && \
echo "**** install runtime packages ****" && \
apk add --no-cache \
libxml2 \
mariadb-client \
php81-bcmath \
php81-ctype \
php81-curl \
php81-exif \
php81-gd \
php81-iconv \
php81-ldap \
php81-pdo_mysql \
php81-pdo_sqlite \
php81-pecl-redis \
php81-phar \
php81-sodium \
php81-sqlite3 \
php81-tokenizer \
php81-xmlreader \
php81-zip && \
apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \
php81-pecl-mcrypt && \
php83-bcmath \
php83-exif \
php83-gd \
php83-ldap \
php83-pdo_mysql \
php83-pdo_sqlite \
php83-pecl-redis \
php83-sodium \
php83-sqlite3 \
php83-tokenizer \
php83-xmlreader \
php83-pecl-mcrypt && \
echo "**** configure php-fpm to pass env vars ****" && \
sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php81/php-fpm.d/www.conf && \
grep -qxF 'clear_env = no' /etc/php81/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php81/php-fpm.d/www.conf && \
echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php81/php-fpm.conf && \
sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php83/php-fpm.d/www.conf && \
grep -qxF 'clear_env = no' /etc/php83/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php83/php-fpm.d/www.conf && \
echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php83/php-fpm.conf && \
echo "**** install snipe-it ****" && \
mkdir -p \
/app/www/ && \
Expand All @@ -59,10 +50,10 @@ RUN \
"/app/www/storage" \
"/app/www/public/uploads" \
/defaults/ && \
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies && \
rm -rf \
$HOME/.cache \
$HOME/.composer \
/tmp/*

Expand All @@ -71,4 +62,5 @@ COPY root/ /

# ports and volumes
EXPOSE 80 443

VOLUME /config
6 changes: 3 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ pipeline {
DIST_IMAGE = 'alpine'
MULTIARCH='true'
CI='true'
CI_WEB='false'
CI_WEB='true'
CI_PORT='80'
CI_SSL='false'
CI_DELAY='120'
CI_DOCKERENV='APP_URL=http://localhost:80|NGINX_APP_URL=_|DB_CONNECTION=sqlite_testing'
CI_AUTH='user:password'
CI_WEBPATH=''
CI_AUTH=''
CI_WEBPATH='/setup'
}
stages {
// Setup all the basic environment variables needed for the build
Expand Down
67 changes: 35 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Find us at:

[Snipe-it](https://github.com/snipe/snipe-it) makes asset management easy. It was built by people solving real-world IT and asset management problems, and a solid UX has always been a top priority. Straightforward design and bulk actions mean getting things done faster.

[![snipe-it](https://s3-us-west-2.amazonaws.com/linuxserver-docs/images/snipe-it-logo500x500.png)](https://github.com/snipe/snipe-it)
[![snipe-it](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/snipe-it-logo.png)](https://github.com/snipe/snipe-it)

## Supported Architectures

Expand All @@ -59,14 +59,10 @@ The architectures supported by this image are:

## Application Setup

"Access the webui at `<your-ip>:8080`, for more information check out [Snipe-it](https://github.com/snipe/snipe-it).
Access the webui at `<your-ip>:8080`, for more information check out [Snipe-it](https://github.com/snipe/snipe-it).

**This container requires a MySQL or MariaDB server to connect to, we recommend [ours](https://github.com/linuxserver/docker-mariadb)**

### PHP customization

This image uses our NGINX base image all override configuration files for PHP are located in `/config/php`.

## Usage

To help you get started creating a container from this image you can either use docker-compose or the docker cli.
Expand All @@ -83,24 +79,26 @@ services:
- PUID=1000
- PGID=1000
- TZ=Etc/UTC
- APP_KEY=
- APP_URL=http://localhost:8080
- MYSQL_PORT_3306_TCP_ADDR=
- MYSQL_PORT_3306_TCP_PORT=
- MYSQL_DATABASE=
- MYSQL_USER=
- MYSQL_PASSWORD=
- APP_ENV=production #optional
- APP_DEBUG=false #optional
- APP_ENV=production #optional
- APP_FORCE_TLS=false #optional
- APP_LOCALE= #optional
- MAIL_PORT_587_TCP_ADDR=US/Pacific #optional
- MAIL_PORT_587_TCP_PORT=US/Pacific #optional
- MAIL_ENV_FROM_ADDR=US/Pacific #optional
- MAIL_ENV_FROM_NAME=US/Pacific #optional
- MAIL_ENV_ENCRYPTION=US/Pacific #optional
- MAIL_ENV_USERNAME=US/Pacific #optional
- MAIL_ENV_PASSWORD=US/Pacific #optional
- MAIL_PORT_587_TCP_ADDR= #optional
- MAIL_PORT_587_TCP_PORT= #optional
- MAIL_ENV_FROM_ADDR= #optional
- MAIL_ENV_FROM_NAME= #optional
- MAIL_ENV_ENCRYPTION= #optional
- MAIL_ENV_USERNAME= #optional
- MAIL_ENV_PASSWORD= #optional
volumes:
- /path/to/data:/config
- /path/to/snipe-it/data:/config
ports:
- 8080:80
restart: unless-stopped
Expand All @@ -114,24 +112,26 @@ docker run -d \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=Etc/UTC \
-e APP_KEY= \
-e APP_URL=http://localhost:8080 \
-e MYSQL_PORT_3306_TCP_ADDR= \
-e MYSQL_PORT_3306_TCP_PORT= \
-e MYSQL_DATABASE= \
-e MYSQL_USER= \
-e MYSQL_PASSWORD= \
-e APP_ENV=production `#optional` \
-e APP_DEBUG=false `#optional` \
-e APP_ENV=production `#optional` \
-e APP_FORCE_TLS=false `#optional` \
-e APP_LOCALE= `#optional` \
-e MAIL_PORT_587_TCP_ADDR=US/Pacific `#optional` \
-e MAIL_PORT_587_TCP_PORT=US/Pacific `#optional` \
-e MAIL_ENV_FROM_ADDR=US/Pacific `#optional` \
-e MAIL_ENV_FROM_NAME=US/Pacific `#optional` \
-e MAIL_ENV_ENCRYPTION=US/Pacific `#optional` \
-e MAIL_ENV_USERNAME=US/Pacific `#optional` \
-e MAIL_ENV_PASSWORD=US/Pacific `#optional` \
-e MAIL_PORT_587_TCP_ADDR= `#optional` \
-e MAIL_PORT_587_TCP_PORT= `#optional` \
-e MAIL_ENV_FROM_ADDR= `#optional` \
-e MAIL_ENV_FROM_NAME= `#optional` \
-e MAIL_ENV_ENCRYPTION= `#optional` \
-e MAIL_ENV_USERNAME= `#optional` \
-e MAIL_ENV_PASSWORD= `#optional` \
-p 8080:80 \
-v /path/to/data:/config \
-v /path/to/snipe-it/data:/config \
--restart unless-stopped \
lscr.io/linuxserver/snipe-it:latest
```
Expand All @@ -146,22 +146,24 @@ Containers are configured using parameters passed at runtime (such as those abov
| `-e PUID=1000` | for UserID - see below for explanation |
| `-e PGID=1000` | for GroupID - see below for explanation |
| `-e TZ=Etc/UTC` | specify a timezone to use, see this [list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List). |
| `-e APP_KEY=` | App key used for encrypting stored data. Generate with `docker exec snipe-it php /app/www/artisan key:generate --show`. |
| `-e APP_URL=http://localhost:8080` | Hostname or IP and port if applicable, be sure to define https/http |
| `-e MYSQL_PORT_3306_TCP_ADDR=` | Mysql hostname or IP to use |
| `-e MYSQL_PORT_3306_TCP_PORT=` | Mysql port to use |
| `-e MYSQL_DATABASE=` | Mysql database to use |
| `-e MYSQL_USER=` | Mysql user to use |
| `-e MYSQL_PASSWORD=` | Mysql password to use |
| `-e APP_ENV=production` | Default is `production` but can use `testing` or `develop`. |
| `-e APP_DEBUG=false` | Set to `true` to see debugging output in the web UI. |
| `-e APP_ENV=production` | Default is `production` but can use `testing` or `develop`. |
| `-e APP_FORCE_TLS=false` | Set to `true` if running behind a reverse proxy |
| `-e APP_LOCALE=` | Default is `en`. Set to a language from [this list](https://snipe-it.readme.io/docs/configuration#section-setting-a-language). |
| `-e MAIL_PORT_587_TCP_ADDR=US/Pacific` | SMTP mail server ip or hostname. |
| `-e MAIL_PORT_587_TCP_PORT=US/Pacific` | SMTP mail server port. |
| `-e MAIL_ENV_FROM_ADDR=US/Pacific` | The email address mail should be replied to and listed when sent. |
| `-e MAIL_ENV_FROM_NAME=US/Pacific` | The name listed on email sent from the default account on the system. |
| `-e MAIL_ENV_ENCRYPTION=US/Pacific` | Mail encryption to use e.g. `tls`. |
| `-e MAIL_ENV_USERNAME=US/Pacific` | SMTP server login username. |
| `-e MAIL_ENV_PASSWORD=US/Pacific` | SMTP server login password. |
| `-e MAIL_PORT_587_TCP_ADDR=` | SMTP mail server ip or hostname. |
| `-e MAIL_PORT_587_TCP_PORT=` | SMTP mail server port. |
| `-e MAIL_ENV_FROM_ADDR=` | The email address mail should be replied to and listed when sent. |
| `-e MAIL_ENV_FROM_NAME=` | The name listed on email sent from the default account on the system. |
| `-e MAIL_ENV_ENCRYPTION=` | Mail encryption to use e.g. `tls`. |
| `-e MAIL_ENV_USERNAME=` | SMTP server login username. |
| `-e MAIL_ENV_PASSWORD=` | SMTP server login password. |
| `-v /config` | Contains your config files and data storage for Snipe-IT |

## Environment variables from files (Docker secrets)
Expand Down Expand Up @@ -325,6 +327,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64

## Versions

* **17.06.24:** - Rebase to Alpine 3.20. Existing users should update their nginx confs to avoid http2 deprecation warnings.
* **06.03.24:** - Existing users should update: site-confs/default.conf - Cleanup default site conf.
* **17.02.24:** - Add php81-exif.
* **03.07.23:** - Deprecate armhf. As announced [here](https://www.linuxserver.io/blog/a-farewell-to-arm-hf)
Expand Down
6 changes: 3 additions & 3 deletions jenkins-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ repo_vars:
- DIST_IMAGE = 'alpine'
- MULTIARCH='true'
- CI='true'
- CI_WEB='false'
- CI_WEB='true'
- CI_PORT='80'
- CI_SSL='false'
- CI_DELAY='120'
- CI_DOCKERENV='APP_URL=http://localhost:80|NGINX_APP_URL=_|DB_CONNECTION=sqlite_testing'
- CI_AUTH='user:password'
- CI_WEBPATH=''
- CI_AUTH=''
- CI_WEBPATH='/setup'
sponsor_links:
- { name: "Snipe-IT", url: "https://snipeitapp.com/donate" }
29 changes: 14 additions & 15 deletions readme-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# project information
project_name: snipe-it
project_url: "https://github.com/snipe/snipe-it"
project_logo: "https://s3-us-west-2.amazonaws.com/linuxserver-docs/images/snipe-it-logo500x500.png"
project_logo: "https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/snipe-it-logo.png"
project_blurb: "[{{ project_name|capitalize }}]({{ project_url }}) makes asset management easy. It was built by people solving real-world IT and asset management problems, and a solid UX has always been a top priority. Straightforward design and bulk actions mean getting things done faster."
project_lsio_github_repo_url: "https://github.com/linuxserver/docker-{{ project_name }}"
# supported architectures
Expand All @@ -15,12 +15,13 @@ common_param_env_vars_enabled: true
param_container_name: "{{ project_name }}"
param_usage_include_vols: true
param_volumes:
- {vol_path: "/config", vol_host_path: "/path/to/data", desc: "Contains your config files and data storage for Snipe-IT"}
- {vol_path: "/config", vol_host_path: "/path/to/{{ project_name }}/data", desc: "Contains your config files and data storage for Snipe-IT"}
param_usage_include_ports: true
param_ports:
- {external_port: "8080", internal_port: "80", port_desc: "Snipe-IT Web UI"}
param_usage_include_env: true
param_env_vars:
- {env_var: "APP_KEY", env_value: "", desc: "App key used for encrypting stored data. Generate with `docker exec snipe-it php /app/www/artisan key:generate --show`."}
- {env_var: "APP_URL", env_value: "http://localhost:8080", desc: "Hostname or IP and port if applicable, be sure to define https/http"}
- {env_var: "MYSQL_PORT_3306_TCP_ADDR", env_value: "", desc: "Mysql hostname or IP to use"}
- {env_var: "MYSQL_PORT_3306_TCP_PORT", env_value: "", desc: "Mysql port to use"}
Expand All @@ -30,29 +31,27 @@ param_env_vars:

opt_param_usage_include_env: true
opt_param_env_vars:
- {env_var: "APP_ENV", env_value: "production", desc: "Default is `production` but can use `testing` or `develop`."}
- {env_var: "APP_DEBUG", env_value: "false", desc: "Set to `true` to see debugging output in the web UI."}
- {env_var: "APP_ENV", env_value: "production", desc: "Default is `production` but can use `testing` or `develop`."}
- {env_var: "APP_FORCE_TLS", env_value: "false", desc: "Set to `true` if running behind a reverse proxy"}
- {env_var: "APP_LOCALE", env_value: "", desc: "Default is `en`. Set to a language from [this list](https://snipe-it.readme.io/docs/configuration#section-setting-a-language)."}
- {env_var: "MAIL_PORT_587_TCP_ADDR", env_value: "US/Pacific", desc: "SMTP mail server ip or hostname."}
- {env_var: "MAIL_PORT_587_TCP_PORT", env_value: "US/Pacific", desc: "SMTP mail server port."}
- {env_var: "MAIL_ENV_FROM_ADDR", env_value: "US/Pacific", desc: "The email address mail should be replied to and listed when sent."}
- {env_var: "MAIL_ENV_FROM_NAME", env_value: "US/Pacific", desc: "The name listed on email sent from the default account on the system."}
- {env_var: "MAIL_ENV_ENCRYPTION", env_value: "US/Pacific", desc: "Mail encryption to use e.g. `tls`."}
- {env_var: "MAIL_ENV_USERNAME", env_value: "US/Pacific", desc: "SMTP server login username."}
- {env_var: "MAIL_ENV_PASSWORD", env_value: "US/Pacific", desc: "SMTP server login password."}
- {env_var: "MAIL_PORT_587_TCP_ADDR", env_value: "", desc: "SMTP mail server ip or hostname."}
- {env_var: "MAIL_PORT_587_TCP_PORT", env_value: "", desc: "SMTP mail server port."}
- {env_var: "MAIL_ENV_FROM_ADDR", env_value: "", desc: "The email address mail should be replied to and listed when sent."}
- {env_var: "MAIL_ENV_FROM_NAME", env_value: "", desc: "The name listed on email sent from the default account on the system."}
- {env_var: "MAIL_ENV_ENCRYPTION", env_value: "", desc: "Mail encryption to use e.g. `tls`."}
- {env_var: "MAIL_ENV_USERNAME", env_value: "", desc: "SMTP server login username."}
- {env_var: "MAIL_ENV_PASSWORD", env_value: "", desc: "SMTP server login password."}
# application setup block
app_setup_block_enabled: true
app_setup_block: |
"Access the webui at `<your-ip>:8080`, for more information check out [{{ project_name|capitalize }}]({{ project_url }}).
Access the webui at `<your-ip>:8080`, for more information check out [{{ project_name|capitalize }}]({{ project_url }}).

**This container requires a MySQL or MariaDB server to connect to, we recommend [ours](https://github.com/linuxserver/docker-mariadb)**

### PHP customization

This image uses our NGINX base image all override configuration files for PHP are located in `/config/php`.

# changelog
changelogs:
- {date: "17.06.24:", desc: "Rebase to Alpine 3.20. Existing users should update their nginx confs to avoid http2 deprecation warnings."}
- {date: "06.03.24:", desc: "Existing users should update: site-confs/default.conf - Cleanup default site conf."}
- {date: "17.02.24:", desc: "Add php81-exif."}
- {date: "03.07.23:", desc: "Deprecate armhf. As announced [here](https://www.linuxserver.io/blog/a-farewell-to-arm-hf)"}
Expand Down
Loading