Skip to content
Open
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
3 changes: 3 additions & 0 deletions infrastructure/dev_env/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ DB_USERNAME=docker
DB_PASSWORD=password
DB_DATABASE=starter

UID=1000 # use command id -u your_user_name to retreive
GID=100 # use command id -g your_user_name to retreive

# If you already have the port 80 in use, you can change it (for example if you have Apache)
HOST_MACHINE_UNSECURE_HOST_PORT=80

Expand Down
13 changes: 13 additions & 0 deletions infrastructure/dev_env/bin/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,16 @@ RUN curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-m
&& docker-php-ext-configure memcached --disable-memcached-sasl \
&& docker-php-ext-install memcached \
&& rm /tmp/memcached.tar.gz

ARG UID=1000
ARG GID=1000

RUN sed -i 's#/usr/sbin/nologin#/bin/sh#' /etc/passwd

# Update UID and GID in /etc/passwd and /etc/group
RUN sed -i "s/www-data:x:33:33/www-data:x:${UID}:${GID}/" /etc/passwd \
&& sed -i "s/www-data:x:33:/www-data:x:${GID}:/" /etc/group

USER www-data

WORKDIR /var/www/html/starter/server/api
9 changes: 9 additions & 0 deletions infrastructure/dev_env/bin/node/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,13 @@ FROM node:18

WORKDIR /usr/app

ARG UID=1000
ARG GID=1000

# Update UID and GID in /etc/passwd and /etc/group
RUN sed -i "s/node:x:1000:1000/node:x:${UID}:${GID}/" /etc/passwd \
&& sed -i "s/node:x:1000:/node:x:${GID}:/" /etc/group

USER node

EXPOSE 3030
6 changes: 6 additions & 0 deletions infrastructure/dev_env/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ services:
build:
context: ./bin/app
dockerfile: Dockerfile
args:
UID: ${UID}
GID: ${GID}
container_name: app
restart: always
# The external port mapping to internal port mapping
Expand Down Expand Up @@ -54,6 +57,9 @@ services:
node:
build:
context: ./bin/node
args:
UID: ${UID}
GID: ${GID}
container_name: node
restart: always
tty: true
Expand Down