Skip to content

Commit 9c5d80e

Browse files
committed
Fix docker permission issues
1 parent 87dcc04 commit 9c5d80e

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

.docker/.env.dist

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
# General configuration options.
22
COMPOSE_PROJECT_NAME=brick-geo
33

4+
# Your user id and group id. Update these values if you are not using the default 1000:1000.
5+
# Use `id -u` to get your UID, and `id -g` to get your GID.
6+
UID=1000
7+
GID=1000
8+
49
# Software versions.
510
PHP_VERSION=8.4
611
GEOSOP_VERSION=3.13.1
712
POSTGRES_VERSION=17
813
POSTGIS_VERSION=3
914

1015
# Paths.
11-
SOURCES_PATH=/application
16+
SOURCES_PATH=/app
1217
GEOSOP_PATH=/usr/local/bin/geosop
1318

1419
# Postgres credentials.

.docker/compose.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ services:
66
args:
77
- PHP_VERSION
88
- GEOSOP_VERSION
9+
- UID
10+
- GID
911
volumes:
1012
- ..:${SOURCES_PATH}
1113
- ${SOURCES_PATH}/.git # Do not expose .git directory

.docker/php/Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ EOF
4646

4747
FROM php:${PHP_VERSION}-cli
4848

49+
ARG UID
50+
ARG GID
51+
4952
SHELL ["/bin/sh", "-e", "-c"]
5053

5154
RUN <<EOF
@@ -70,4 +73,9 @@ COPY --from=geosop-builder /usr/local/bin/geosop /usr/local/bin/geosop
7073
# Composer
7174
COPY --from=composer /usr/bin/composer /usr/bin/composer
7275

76+
RUN groupadd -g ${GID} user
77+
RUN useradd -u ${UID} -g ${GID} -m -s /bin/bash user
78+
79+
USER user
80+
7381
CMD sleep infinity

0 commit comments

Comments
 (0)