From 774d5b4c538d93889bf743b6cd7d01a85f8715e6 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Fri, 25 Feb 2022 17:25:10 +0100 Subject: feat: use Docker in production (#12) * build: add experimental feature outputStandalone With this option, Next.js can create a standalone folder with the necessary files for a production deployment. It will be useful for Docker deployment. * chore: add Docker configuration * docs: update README with Docker instructions --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 04c2893..fda3b09 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,22 @@ Even if the source code and the contents are under free licenses, I don't want t Other contents come from WordPress as headless CMS. +## Production + +In any case, you need a reverse-proxy if you want to bind the live app to a domain. + +### With Docker + +Make sure Docker and Docker Compose are installed then, you can run: `sudo docker-compose up -d --build `. + +`` is optional. You don't need it the first time. However, if you want to rebuild and update only one container, it can be useful. + +If you wish to use custom ports, you can edit your `.env` file and specify `APP_DOCKER_PORT_PROD` and `APP_DOCKER_PORT_DEV` variables. By default the ports are respectively `3000` and `3200`. + +### Without Docker + +Just run `yarn build && yarn start`. + ## Development ### First step -- cgit v1.2.3