Skip to content

Commit 9405fd0

Browse files
committed
chore: update Dockerfile ( yarn installation process )
fix: increase user.job_title limit to 200 chars
1 parent 105978d commit 9405fd0

4 files changed

Lines changed: 17 additions & 25 deletions

File tree

Dockerfile

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
FROM php:8.3-fpm
22

33
ARG DEBIAN_FRONTEND=noninteractive
4-
ARG NVM_VERSION="v0.39.7"
4+
ARG NVM_VERSION="v0.40.3"
5+
ENV NODE_VERSION="18.20.4"
6+
ARG YARN_VERSION="1.22.22"
57
ARG GITHUB_OAUTH_TOKEN
68
ARG XDEBUG_VERSION="xdebug-3.3.2"
79

810
ENV NVM_VERSION=$NVM_VERSION
9-
ENV NODE_VERSION="18.20.4"
1011
ENV NVM_DIR=/root/.nvm
1112
ENV COMPOSER_ALLOW_SUPERUSER=1
1213
ENV GITHUB_OAUTH_TOKEN=$GITHUB_OAUTH_TOKEN
@@ -40,26 +41,16 @@ COPY docker-compose/php/docker-php-ext-xdebug.ini $PHP_DIR/conf.d/docker-php-ext
4041
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
4142
RUN echo 'memory_limit = 512M' >> $PHP_INI_DIR/php.ini;
4243

43-
# nvm
44-
45-
RUN mkdir $NVM_DIR \
46-
&& curl https://raw.githubusercontent.com/creationix/nvm/$NVM_VERSION/install.sh | bash \
47-
&& . $NVM_DIR/nvm.sh \
48-
&& nvm install $NODE_VERSION \
49-
&& nvm alias default $NODE_VERSION \
50-
&& nvm use default
51-
52-
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
53-
ENV PATH $NVM_DIR/v$NODE_VERSION/bin:$PATH
54-
55-
# yarn
56-
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
57-
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
58-
RUN apt update && apt install -y yarn
44+
# nvm + node + yarn via corepack
45+
ENV NVM_DIR=/root/.nvm
46+
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/$NVM_VERSION/install.sh | bash
47+
# Install Node, enable Corepack (Yarn)
48+
RUN bash -lc "source $NVM_DIR/nvm.sh && nvm install $NODE_VERSION && corepack enable && corepack prepare yarn@$YARN_VERSION --activate"
49+
RUN apt clean && rm -rf /var/lib/apt/lists/*
5950

60-
# install node
61-
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
62-
RUN apt-get install -y nodejs
51+
# Set up our PATH correctly so we don't have to long-reference npm, node, &c.
52+
ENV NODE_PATH=$NVM_DIR/versions/node/v$NODE_VERSION/lib/node_modules
53+
ENV PATH=$NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
6354

6455
WORKDIR /var/www
6556
COPY . /var/www

app/Http/Controllers/Factories/UserValidationRulesFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static function build(array $data, $update = false, ?User $currentUser =
5454
'password' => 'sometimes|string|confirmed|password_policy',
5555
'phone_number' => 'nullable|string',
5656
'company' => 'nullable|string',
57-
'job_title' => 'nullable|string',
57+
'job_title' => 'nullable|string|max:200',
5858
// admin fields
5959
'email_verified' => 'nullable|boolean',
6060
'active' => 'nullable|boolean',
@@ -101,7 +101,7 @@ public static function build(array $data, $update = false, ?User $currentUser =
101101
'password' => 'sometimes|string|confirmed|password_policy',
102102
'phone_number' => 'nullable|string',
103103
'company' => 'nullable|string',
104-
'job_title' => 'nullable|string',
104+
'job_title' => 'nullable|string|max:200',
105105
// admin fields
106106
'email_verified' => 'nullable|boolean',
107107
'active' => 'nullable|boolean',

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,5 +113,6 @@
113113
"typeahead.js": "^0.11.1",
114114
"urijs": "^1.19.1",
115115
"yup": "^0.32.11"
116-
}
116+
},
117+
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
117118
}

resources/js/admin/edit_user/edit_user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ const EditUserPage = ({
643643
fullWidth
644644
size="small"
645645
label="Job Title"
646-
inputProps={{maxLength: 10}}
646+
inputProps={{maxLength: 200}}
647647
value={formik.values.job_title}
648648
onChange={formik.handleChange}
649649
error={

0 commit comments

Comments
 (0)