Commit graph

6 commits

Author SHA1 Message Date
Jonas Strassel
638e6d16f8
chore(with-docker): don't copy package.json twice (#39896)
the directory `/app/.next/standalone` already contains a copy of the package.json so we can skip copying it before we copy the standalone dir

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm lint`
- [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-08-24 09:35:44 -05:00
Duc Tran
b7997105a0
fix: use if...else in dockerfile (#39263)
* fix: use if-else in dockerfile

* fix: remove typo
2022-08-02 17:01:24 -05:00
Lafif Astahdziq
377fddfaa9
fix: missing semicolon on Dockerfile (#39142)
The commit 0a781dd675 changes the docker examples to use `if..elif..else`

it is working fine tor the `with-docker` example, but not working for the `with-docker-compose` and `with-docker-multi-env` examples due to a missing semicolon.

Fix #39085



## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-07-28 15:23:11 +00:00
Balázs Orbán
0a781dd675
fix: use if..elif..else in docker examples (#39072)
* fix: use `if..elif..else` in docker examples

* fix missing devDependencies for build

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-07-27 09:54:04 -05:00
Balázs Orbán
35a3243854
chore: auto-detect preferred package manager in Dockerfile (#38693) 2022-07-18 13:45:39 -05:00
Max Proske
78809a3d68
Add with-docker-compose example (#32668)
`with-docker-compose` contains everything needed to get Next.js up and running with Docker Compose.

This example aims to provide an easy-to-use, Next.js app development and production environment, **all without Node.js being installed** on the host machine. This ensures a consistent development environment across Windows, MacOS, and Linux teams.

I was inspired to create this, because the existing [with-docker](https://github.com/vercel/next.js/tree/canary/examples/with-docker) example only uses Docker to build the final production artifacts, not provide a development environment. Docker Compose easily syncs changes with containers for Hot Reloading, parallel builds, and networking, making it a powerful and consistent development tool.

Developers can **easily extend this example** by modifying the YAML files to include Nginx, Postgres, and other Docker images. 

This example takes advantage of Docker multistage builds combined with the Next 12.1 [Output Standalone](https://nextjs.org/docs/advanced-features/output-file-tracing#automatically-copying-traced-files-experimental) feature, to create up to **80% smaller apps** (Approximately 110 MB compared to 1 GB with create-next-app). I also included an example without multistage builds, for developers who don't want to get into the weeds.

I have been tweaking this Docker Compose setup over 3 years of real world use, but please let me know if anything can be improved.
2022-06-14 11:13:55 +00:00