Comments (20)
I removed the single and double quotes didn't help.
Any other way to resolved this?
from docker.
Ah, must have left that in there while trying things. I've been working on this locally today, I'll see if I can clean it up
from docker.
Same thing here. I mounted schema.prisma via docker-compose to override the default one at /app/prisma/schema.prisma
volumes:
- ./schema.prisma:/app/prisma/schema.prisma
By the way, did you notice that /bin/sh
on Calendso instance is not working. Docker exec spits back to the terminal without errors.
from docker.
I've been seeing that as well. This won't be a final solution anyways, however, because we won't want to use yarn dev in production. I'll typically move yarn dev
to command
in the docker-compose file, and how how to mount a local volume for using docker-compose for development. Still working on a proper prod build and have notes on some of the other threads.
@vanceism7 I have that JWT_SECRET included in mine after copying some extras from calendso/calendso while debugging. good pointer!
from docker.
To come back to this for those watching. On the latest version, the docker image appears to build and run just fine, but there are some of the same issues in dwrb's comment above with the absolute URL stuff (that's next.js related)
But for this issue, in some cases docker-compose doesn't like combining variables within the .env file
(such as DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DATABASE_HOST}/${POSTGRES_DB}
)
but if you add the same environmental variable to the docker-compose.yml, then it will combine those and take precedent over the variable in the .env file.
calendso:
build: .
restart: always
ports:
- 3000:3000
- 5555:5555
env_file: .env
environment:
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DATABASE_HOST}/${POSTGRES_DB}
depends_on:
- db
without:
calendso_1 | Prisma schema loaded from prisma/schema.prisma
calendso_1 | Datasource "db": PostgreSQL database "$%7BPOSTGRES_DB%7D", schema "public" at "${DATABASE_HOST}:5432"
calendso_1 | Error: Migration engine error:
calendso_1 | [libs/datamodel/core/src/ast/parser/parse_expression.rs:88:18] internal error: entered unreachable code: Encountered impossible string content during parsing: Pair { rule: string_interpolate_escape, span: Span { str: "${POSTGRES_USER}", start: 105, end: 121 }, inner: [Pair { rule: expression, span: Span { str: "POSTGRES_USER", start: 107, end: 120 }, inner: [Pair { rule: constant_literal, span: Span { str: "POSTGRES_USER", start: 107, end: 120 }, inner: [] }] }] }
calendso_1 | + yarn start
calendso_1 | yarn run v1.22.15
calendso_1 | $ next start
calendso_1 | ready - started server on 0.0.0.0:3000, url: http://localhost:3000
with:
calendso_1 | Prisma schema loaded from prisma/schema.prisma
calendso_1 | Datasource "db": PostgreSQL database "calendso", schema "public" at "db:5432"
calendso_1 |
calendso_1 | 39 migrations found in prisma/migrations
calendso_1 |
calendso_1 | No pending migrations to apply.
calendso_1 | + yarn start
calendso_1 | yarn run v1.22.15
calendso_1 | $ next start
calendso_1 | ready - started server on 0.0.0.0:3000, url: http://localhost:3000
from docker.
The single/double quotes must be removed from the .env file in order for this to work properly. Docker doesn't respect them in the env files.
working example: (I added POSTGRES_HOST for better capability with start.sh)
DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}/${POSTGRES_DB}
This also affects the GOOGLE_API_CREDENTIALS, the json object must not be wrapped in quotes or else the variable is interpreted as '{}'
With single quotes:
warn - Disabled 'Google Calendar' integration. Reason: Invalid value for GOOGLE_API_CREDENTIALS environment variable. When set, this value needs to contain valid JSON like {"web":{"client_id":"<clid>","client_secret":"<secret>","redirect_uris":["<yourhost>/api/integrations/googlecalendar/callback>"]}. You can download this JSON from your OAuth Client @ https://console.cloud.google.com/apis/credentials.
Tested on Docker Desktop 4.1 in WSL
https://dev.to/tvanantwerp/don-t-quote-environment-variables-in-docker-268h
from docker.
same issue, removed the quotes but still getting the same error
from docker.
@kelvinalfaro @agapejon does anything change if you use yarn dev
instead of yarn start
?
also, I did some significant rework of the dockerfile, since I had other issues with the use of yarn build that I haven't pushed through yet. yarn build
is likely generating static files at docker build time, which wont include the .env variables used by docker-compose. yarn dev
should support runtime compile with env vars.
FROM node:14-alpine as deps
RUN apk add --no-cache libc6-compat
RUN mkdir app
COPY calendso/package.json calendso/yarn.lock /app/
COPY calendso/prisma /app/prisma
WORKDIR /app
RUN ls
RUN yarn install
FROM node:14-alpine as builder
COPY calendso /app
COPY --from=deps /app/node_modules /app/node_modules
WORKDIR /app
# RUN yarn install
FROM node:14-alpine as runner
ENV NODE_ENV production
# copy all files
COPY --from=builder /app /app
COPY .env /app/.env
# COPY --from=builder /app/next.config.js ./
# COPY --from=builder /app/public ./public
# COPY --from=builder /app/.next ./.next
# COPY --from=builder /app/node_modules ./node_modules
# COPY --from=builder /app/package.json ./package.json
# COPY --from=builder /app/prisma ./prisma
COPY scripts /app/scripts
WORKDIR /app
EXPOSE 3000
CMD ["/app/scripts/start.sh"]
(disclaimer, this dockerfile can be much more efficient, but I reworked some things for my own clarity while debugging)
from docker.
Thanks. This worked well. Though I gave up on it for now. Once it deployed, i was unable to set up the database. Maybe will try again soon. Your response was really appreciated however.
from docker.
That may be a combination with my other issue posted. I'll get a WIP branch up to try early this week
from docker.
@krumware Trying the new Dockerfile got me further in the process, but I get this error when running
sudo docker-compose up --build
error:
Error: Could not find a production build in the '/app/.next' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id
Adding yarn build
into the start.sh
script got the app to run successfully, but not sure if that's really the proper thing to do here
from docker.
Can you also by chance try yarn dev
instead of yarn build in the start file?
from docker.
Ah, yea, using the new dockerfile you provided + changing yarn start
to yarn dev
in scripts/start.sh
got it working. Thanks!
from docker.
Ah wait, nvm. If I replace yarn start
with yarn dev
- docker-compose successfully starts the app, but then the app doesn't actually work. The website spews the following error:
TypeError: (0 , react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV) is not a function
Naively searching for that error online, I found this
vercel/next.js#26983
Keeping yarn start
and adding yarn build
the line before seems to avoid this error
from docker.
great extra note, I saw that before and added NODE_ENV=development
to my local .env, which fixed that. But I missed adding that here.
Can you please try that? add NODE_ENV=development
to your .env file then try yarn dev
as before?
from docker.
Just tried it - its working!
Just a note, the app is getting stuck on the log-in screen, but since this is unrelated to this issue in particular, I'll create a new issue for this. Thanks again for your help
Ok, just for posterity, this login hanging issue seems to be stemming from a new environmental variable requirement.
We now need to add to our .env file a variable: JWT_SECRET=b6182e2660addf13ec964a5c512c2f5d35d52da8
https://github.com/calendso/calendso/issues/760
from docker.
I've been following along and this evening went through these steps (Replaced Dockerfile, added NODE_ENV=development, changed yarn start
to yarn dev
) and we get to the following, and it then hangs:
although it seems hitting the container on :3000 triggers the JIT compilation and throws this error:
It feels like we're nearly there.
from docker.
Thanks @krumware I’ll give it a go this weekend.
from docker.
Sounds good! please see #37
from docker.
The single/double quotes must be removed from the .env file in order for this to work properly. Docker doesn't respect them in the env files.
working example: (I added POSTGRES_HOST for better capability with start.sh)
DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}/${POSTGRES_DB}
This also affects the GOOGLE_API_CREDENTIALS, the json object must not be wrapped in quotes or else the variable is interpreted as
'{}'
With single quotes:
warn - Disabled 'Google Calendar' integration. Reason: Invalid value for GOOGLE_API_CREDENTIALS environment variable. When set, this value needs to contain valid JSON like {"web":{"client_id":"<clid>","client_secret":"<secret>","redirect_uris":["<yourhost>/api/integrations/googlecalendar/callback>"]}. You can download this JSON from your OAuth Client @ https://console.cloud.google.com/apis/credentials.
Tested on Docker Desktop 4.1 in WSL https://dev.to/tvanantwerp/don-t-quote-environment-variables-in-docker-268h
Thank you :-)
from docker.
Related Issues (20)
- Not able to login after upgrade HOT 2
- Versions 3.8.4+ are not published HOT 1
- Context deadline exceeded during build process
- SMTP server configuration only working/used when running on Laptop, but not virtual host HOT 1
- docker compose build failed with errors HOT 15
- google calendar connection doesn't work
- can we remove sign up for calcom HOT 1
- invalid prisma user? HOT 2
- Update hub.docker HOT 5
- 要是支持Luna日历就好了
- @calcom/web:build: ERROR: command finished with error: command (/calcom/apps/web) yarn run build exited (129) HOT 5
- App switch on on restart HOT 1
- Upgrade to v3.9.1 from v3.2.x ALLOWED_HOSTNAMES & Duplicate value not found
- cal.com Docker container keeps restarting: "autocheckin: This package doesn't seem to be present in your lockfile" HOT 2
- Docker Hub and calcom.docker.scarf.sh/calcom/cal.com don't get new updates since 3.9.1
- Zapier connection "API key not valid"
- ARM64 Image is needed. HOT 1
- domain/embed/embed.js returns 404 error HOT 4
- Docker image versioning strategy
- yarn.lock file seems not to be up-to-date with dependencies
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker.