-
Notifications
You must be signed in to change notification settings - Fork 1
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
basic docker files #45
Conversation
# Copy the built artifacts from the builder stage | ||
COPY --from=builder /app/.next/standalone ./ | ||
COPY --from=builder /app/.next/static ./.next/static | ||
COPY --from=builder /app/public ./public |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
next.config.js
Outdated
@@ -4,15 +4,15 @@ const path = require('path'); | |||
* @type {import('next').NextConfig} | |||
*/ | |||
const nextConfig = { | |||
output: 'export', | |||
output: 'standalone', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dockerfile
Outdated
RUN npm install | ||
|
||
COPY . . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's important to note here that since we're copying files from our local machines into the image (rather than sharing the files between host and container) we won't be able to do things like install new packages as we're working without rebuilding/rerunning the container after we make a change. Files also won't fast refresh in the browser as we work since the files are being copied rather than shared.
I think we have two options:
- Rework this image and/or use docker compose for local development so we can share files between host and container (in my experience, this can create its own set of issues)
- Forget using Docker for local dev work, only keep Docker files needed for the prod build, and continue to work locally
What do you think? Personally, I'd most likely continue to work locally whether we have a local dev Docker setup or not since it's been very painless for me so far, so I'd say it's up to you on whether or not you think it's worth putting some effort into.
Adds basic docker files for dev and prod