Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(parser): Added Docker support with new parameter to define output path for exported files #272

Merged

Conversation

janpelikan
Copy link

feat(parser): Added Docker support with new parameter to define output path for exported files

  • Dockerfile:

    • Added new file Dockerfile for building Docker image.
  • README.md:

    • Added section for Docker
    • A usage of application updated to include new parameters -p and --output-path.
  • app.ts:

    • Added new variable outputPath to define the path of the output file.
    • Updated function for parsing input parameters to include the new parameters -p and --output-path with defined default value.
    • Updated console.log messages to include the new parameters.
    • Updated constant for calling a Chromium browser, including new arguments for launching browser in Docker container.
    • Updated calling writeJson and writeCsv functions to include the new outputPath parameter.
  • write.ts:

    • Function writeJson: Added new parameter outputPath to define the path of the output file.
    • Function writeJson: Updated constant outFilename where base path is defined by outputPath variable, not hard-coded anymore.
    • Function writeCsv: Added new parameter outputPath to define the path of the output file.
    • Function writeCsv: Updated constant outFilename where base path is defined by outputPath variable, not hard-coded anymore.

…t path for exported files

- **Dockerfile**:
  - Added new file Dockerfile for building Docker image.

- **README.md**:
  - Added section for Docker
  - A usage of application updated to include new parameters `-p` and `--output-path`.

- **app.ts**:
  - Added new variable `outputPath` to define the path of the output file.
  - Updated function for parsing input parameters to include the new parameters `-p` and `--output-path` with defined default value.
  - Updated `console.log` messages to include the new parameters.
  - Updated constant for calling a Chromium browser, including new arguments for launching browser in Docker container.
  - Updated calling `writeJson` and `writeCsv` functions to include the new `outputPath` parameter.

- **write.ts**:
  - Function `writeJson`: Added new parameter `outputPath` to define the path of the output file.
  - Function `writeJson`: Updated constant `outFilename` where base path is defined by `outputPath` variable, not hard-coded anymore.
  - Function `writeCsv`: Added new parameter `outputPath` to define the path of the output file.
  - Function `writeCsv`: Updated constant `outFilename` where base path is defined by `outputPath` variable, not hard-coded anymore.
@gabrielweyer gabrielweyer linked an issue Sep 20, 2024 that may be closed by this pull request
Copy link
Owner

@gabrielweyer gabrielweyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for a detailed PR description and updating the documentation :)

Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
parser/src/app.ts Show resolved Hide resolved
parser/src/app.ts Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
… review suggestions from PR accepted and implemented

- **Dockerfile**:
  - Fixed obsolete definition of ENVIROMENT variables to correct syntax.
  - Added source link for more information about depebdencies for Puppeteer respectivly Chromium/Chrome in Docker.
  - Dockerfiile moved to `parser` directory.
  - Updated path for `COPY` command.
  - Removed commented code for creataing a new user in Docker. This is not needed for the current implementation.

- **README.md**:
  - Section for Docker updated with new instructions.

- **app.ts**:
  -  Variable `outputPath`: Default value is set to `./out`. Variable is now validated twice.
  -  Variable `outputPath`: Always is checked if path exists. If not, it will be created.
  -  Added source link for more information about calling Chrome/Chromium with `--no-sandbox` flag in Docker while running Puppeteer.
@gabrielweyer gabrielweyer merged commit b7818d5 into gabrielweyer:main Sep 24, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Dockerfile with Node.js and Yarn
2 participants