Skip to content

Commit 8be380b

Browse files
coliseeRobin Alexander
andauthored
Enable rootless container execution (podman) (#140)
* Switch to ports 8080 / 8443 to make the image rootless-compatible * Switch to ports 8080 / 8443 in script .examples/insecure/start.sh --------- Co-authored-by: Robin Alexander <colisee@hotmail>
1 parent f425a80 commit 8be380b

4 files changed

Lines changed: 16 additions & 6 deletions

File tree

.examples/insecure/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ services:
1414
depends_on:
1515
- db
1616
ports:
17-
- "80:80"
17+
- "8080:8080"
1818
volumes:
1919
- app_conf:/config
2020
env_file:
@@ -33,4 +33,4 @@ services:
3333

3434
volumes:
3535
db_conf:
36-
app_conf:
36+
app_conf:

.examples/insecure/start.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ docker run \
2222
--detach \
2323
--name librebooking-app \
2424
--network mynet \
25-
--publish 80:80 \
25+
--publish 8080:8080 \
2626
--volume librebooking-conf:/config \
2727
--env LB_DATABASE_NAME=librebooking \
2828
--env LB_DATABASE_USER=lb_user \
@@ -51,4 +51,4 @@ docker run \
5151
--env LB_LOGGING_LEVEL=DEBUG \
5252
--env LB_LOGGING_SQL=false \
5353
--env LB_DEFAULT_TIMEZONE=Europe/Zurich \
54-
librebooking/librebooking:develop
54+
librebooking/librebooking:develop

.examples/secure/docker-compose.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ services:
5959
- LB_UPLOADS_IMAGE_UPLOAD_URL=Web/uploads/images
6060
- LB_UPLOADS_RESERVATION_ATTACHMENT_PATH=Web/uploads/reservation
6161
- VIRTUAL_HOST=acme.org
62+
- VIRTUAL_PORT=8080
6263
- VIRTUAL_PATH=/book
6364
- LETSENCRYPT_HOST=acme.org
6465
secrets:
@@ -104,6 +105,7 @@ services:
104105
- LB_LOGGING_SQL=false
105106
- LB_DEFAULT_TIMEZONE=Europe/Zurich
106107
- VIRTUAL_HOST=acme.org
108+
- VIRTUAL_PORT=8080
107109
- LETSENCRYPT_HOST=acme.org
108110
secrets:
109111
- lb_install_pwd
@@ -148,4 +150,4 @@ secrets:
148150
file: ./pwd_lb_inst.txt
149151

150152
networks:
151-
mynet:
153+
mynet:

Dockerfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,14 @@ RUN set -ex; \
5858
mkdir --parent /var/log/librebooking; \
5959
chown www-data:www-data /var/log/librebooking; \
6060
touch /usr/local/etc/php/conf.d/librebooking.ini; \
61-
chown www-data:www-data /usr/local/etc/php/conf.d/librebooking.ini
61+
chown www-data:www-data /usr/local/etc/php/conf.d/librebooking.ini; \
62+
sed \
63+
-i /etc/apache2/ports.conf \
64+
-e 's/Listen 80/Listen 8080/' \
65+
-e 's/Listen 443/Lisen 8443/'; \
66+
sed \
67+
-i /etc/apache2/sites-available/000-default.conf \
68+
-e 's/<VirtualHost *:80>/<VirtualHost *:8080>/';
6269

6370
# Get and customize librebooking
6471
USER www-data
@@ -89,3 +96,4 @@ WORKDIR /
8996
VOLUME /config
9097
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
9198
CMD ["apache2-foreground"]
99+
EXPOSE 8080

0 commit comments

Comments
 (0)