Skip to content

Commit

Permalink
feat(php): Install php-cs-fixer in Dockerfile (#4607)
Browse files Browse the repository at this point in the history
  • Loading branch information
amckinney authored Sep 10, 2024
1 parent d1ee8f8 commit 22884f1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
9 changes: 9 additions & 0 deletions generators/php/codegen/src/asIs/RawClient.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

class RawClient
{
public function __construct()
{
// TODO: Implement me!
}
}
11 changes: 10 additions & 1 deletion generators/php/model/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
FROM node:18-alpine3.18
FROM node:18-alpine3.18 AS node
FROM composer:2.7.9

RUN apk --no-cache add bash curl git zip && git config --global user.name "fern" && git config --global user.email "[email protected]"

RUN composer global require friendsofphp/php-cs-fixer
ENV PATH="$PATH:/root/.composer/vendor/bin"
ENV YARN_CACHE_FOLDER=/.yarn

COPY generators/php/model/dist /dist

# Copy over node contents to be able to run the compiled CLI
COPY --from=node /usr/local/bin/node /usr/local/bin/
COPY --from=node /usr/local/lib/node_modules /usr/local/lib/node_modules
RUN ln -s ../lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm \
&& ln -s ../lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx

ENTRYPOINT ["node", "/dist/cli.cjs"]
11 changes: 10 additions & 1 deletion generators/php/sdk/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
FROM node:18-alpine3.18
FROM node:18-alpine3.18 AS node
FROM composer:2.7.9

RUN apk --no-cache add bash curl git zip && git config --global user.name "fern" && git config --global user.email "[email protected]"

RUN composer global require friendsofphp/php-cs-fixer
ENV PATH="$PATH:/root/.composer/vendor/bin"
ENV YARN_CACHE_FOLDER=/.yarn

COPY generators/php/sdk/dist /dist
COPY generators/php/sdk/features.yml /assets/features.yml

# Copy over node contents to be able to run the compiled CLI
COPY --from=node /usr/local/bin/node /usr/local/bin/
COPY --from=node /usr/local/lib/node_modules /usr/local/lib/node_modules
RUN ln -s ../lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm \
&& ln -s ../lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx

ENTRYPOINT ["node", "/dist/cli.cjs"]

0 comments on commit 22884f1

Please sign in to comment.