Skip to content

Commit

Permalink
replaced reserved identifiers UID and GID
Browse files Browse the repository at this point in the history
  • Loading branch information
DevilsAutumn committed Aug 1, 2024
1 parent 8e82d11 commit d63f848
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 32 deletions.
4 changes: 2 additions & 2 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ tasks:
- name: Setup and start the project
command: |
cd /workspace/zango-sandbox/zango
export UID=$(id -u)
export GID=$(id -g)
export HOST_UID=$(id -u)
export HOST_GID=$(id -g)
# Run the gp info --json containing workspace info like workspace_id, url
info=$(gp info --json)
Expand Down
8 changes: 4 additions & 4 deletions deploy/dev.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ RUN apt update
RUN apt-get install -y net-tools
RUN apt install ffmpeg -y

ARG UID
ARG GID
ARG HOST_UID
ARG HOST_GID

# Update the package list, install sudo, create a non-root user, and grant password-less sudo permissions
RUN apt update && \
apt install -y sudo && \
groupadd -o -g $GID -r zango_user && \
adduser --uid $UID --gid $GID --disabled-password --gecos "" zango_user && \
groupadd -o -g $HOST_GID -r zango_user && \
adduser --uid $HOST_UID --gid $HOST_GID --disabled-password --gecos "" zango_user && \
echo 'zango_user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers

# Set the non-root user as the default user
Expand Down
8 changes: 4 additions & 4 deletions deploy/docker_compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ services:
context: .
dockerfile: dev.dockerfile
args:
- UID=${HOST_UID}
- GID=${HOST_GID}
- HOST_UID=${HOST_UID}
- HOST_GID=${HOST_GID}
ports:
- "8000:8000"
depends_on:
Expand All @@ -47,8 +47,8 @@ services:
context: .
dockerfile: dev.dockerfile
args:
- UID=${HOST_UID}
- GID=${HOST_GID}
- HOST_UID=${HOST_UID}
- HOST_GID=${HOST_GID}
command: /bin/sh -c "cd ${PROJECT_NAME} && celery -A ${PROJECT_NAME} worker -l info"
volumes:
- .:/zango/
Expand Down
8 changes: 4 additions & 4 deletions deploy/docker_compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ services:
context: .
dockerfile: prod.dockerfile
args:
- UID=${UID}
- GID=${GID}
- HOST_UID=${HOST_UID}
- HOST_GID=${HOST_GID}
ports:
- "8000:8000"
depends_on:
Expand Down Expand Up @@ -58,8 +58,8 @@ services:
context: .
dockerfile: prod.dockerfile
args:
- UID=${UID}
- GID=${GID}
- HOST_UID=${HOST_UID}
- HOST_GID=${HOST_GID}
command: /bin/sh -c "cd ${PROJECT_NAME} && celery -A ${PROJECT_NAME} worker -l info"
volumes:
- .:/zango/
Expand Down
8 changes: 4 additions & 4 deletions deploy/docker_compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ services:
context: .
dockerfile: test.dockerfile
args:
- UID=${HOST_UID}
- GID=${HOST_GID}
- HOST_UID=${HOST_UID}
- HOST_GID=${HOST_GID}
ports:
- "8000:8000"
depends_on:
Expand All @@ -47,8 +47,8 @@ services:
context: .
dockerfile: test.dockerfile
args:
- UID=${HOST_UID}
- GID=${HOST_GID}
- HOST_UID=${HOST_UID}
- HOST_GID=${HOST_GID}
command: /bin/sh -c "cd ${PROJECT_NAME} && celery -A ${PROJECT_NAME} worker -l info"
volumes:
- .:/zango/
Expand Down
8 changes: 4 additions & 4 deletions deploy/prod.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ RUN pip install gunicorn
RUN apt-get install -y net-tools
RUN apt install ffmpeg -y

ARG UID
ARG GID
ARG HOST_UID
ARG HOST_GID

# Update the package list, install sudo, create a non-root user, and grant password-less sudo permissions
RUN apt update && \
apt install -y sudo && \
groupadd -o -g ${GID} -r zango_user && \
adduser --uid $UID --gid $GID --disabled-password --gecos "" zango_user && \
groupadd -o -g ${HOST_GID} -r zango_user && \
adduser --uid $HOST_UID --gid $HOST_GID --disabled-password --gecos "" zango_user && \
echo 'zango_user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers

# Set the non-root user as the default user
Expand Down
6 changes: 3 additions & 3 deletions deploy/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ To begin using Zango through Docker installation, ensure that Docker and Docker
- `--platform_username`: The user email of the platform user (Default: `[email protected]`).
- `--platform_user_password`: The password for the platform user (Default: `Zango@123`).

5. Docker is started as a non root user, run the below commands to export the host UID and GID
5. Docker is started as a non root user, run the below commands to export the host HOST_UID and HOST_GID

```bash
export UID=$(id -u)
export GID=$(id -g)
export HOST_UID=$(id -u)
export HOST_GID=$(id -g)
```

6. Run `docker compose up` in the project directory to start the project
Expand Down
8 changes: 4 additions & 4 deletions deploy/test.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ RUN apt update
RUN apt-get install -y net-tools
RUN apt install ffmpeg -y

ARG UID
ARG GID
ARG HOST_UID
ARG HOST_GID

# Update the package list, install sudo, create a non-root user, and grant password-less sudo permissions
RUN apt update && \
apt install -y sudo && \
groupadd -o -g $GID -r zango_user && \
adduser --uid $UID --gid $GID --disabled-password --gecos "" zango_user && \
groupadd -o -g $HOST_GID -r zango_user && \
adduser --uid $HOST_UID --gid $HOST_GID --disabled-password --gecos "" zango_user && \
echo 'zango_user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers

# Set the non-root user as the default user
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ To begin using Zango through Docker installation, ensure that Docker and Docker

5. Navigate to ``project_dir`` to start the project.

6. Docker is started as a non root user, run the below commands to export the host UID and GID
6. Docker is started as a non root user, run the below commands to export the host HOST_UID and HOST_GID

```bash
export UID=$(id -u)
export GID=$(id -g)
export HOST_UID=$(id -u)
export HOST_GID=$(id -g)
```

7. Run `docker compose up` in the project directory to start the project
Expand Down

0 comments on commit d63f848

Please sign in to comment.