Attempt at docker building
This commit is contained in:
parent
1b7ee20d05
commit
424359ec0f
1
.dockerignore
Normal file
1
.dockerignore
Normal file
@ -0,0 +1 @@
|
|||||||
|
/Dockerfile
|
11
Dockerfile
Normal file
11
Dockerfile
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
FROM node:21-alpine3.18
|
||||||
|
RUN npm i -g pnpm turbo
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN pnpm install
|
||||||
|
ENV PAYLOAD_CONFIG_PATH=src/payload.config.ts
|
||||||
|
RUN pnpm build
|
||||||
|
|
||||||
|
CMD ["pnpm", "serve"]
|
@ -17,7 +17,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"dotenv": "^8.2.0",
|
"dotenv": "^8.2.0",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"payload": "latest",
|
"payload": "1.12.0",
|
||||||
"@payloadcms/plugin-seo": "latest",
|
"@payloadcms/plugin-seo": "latest",
|
||||||
"@payloadcms/plugin-cloud-storage": "latest",
|
"@payloadcms/plugin-cloud-storage": "latest",
|
||||||
"@aws-sdk/client-s3": "latest",
|
"@aws-sdk/client-s3": "latest",
|
||||||
|
@ -8,6 +8,9 @@ app.get("/", (_, res) => {
|
|||||||
res.redirect("/admin");
|
res.redirect("/admin");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const PORT = process.env.PAYLOAD_PORT ?? 3000,
|
||||||
|
const HOST = process.env.PAYLOAD_ADDRESS ?? 'localhost',
|
||||||
|
|
||||||
const start = async () => {
|
const start = async () => {
|
||||||
// Initialize Payload
|
// Initialize Payload
|
||||||
await payload.init({
|
await payload.init({
|
||||||
@ -24,7 +27,13 @@ const start = async () => {
|
|||||||
|
|
||||||
// Add your own express routes here
|
// Add your own express routes here
|
||||||
|
|
||||||
app.listen(process.env.PAYLOAD_PORT ?? 3000);
|
app.listen(
|
||||||
|
PORT,
|
||||||
|
HOST,
|
||||||
|
() => {
|
||||||
|
console.log(`Server running at http://${HOST}:${PORT}/`);
|
||||||
|
}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
start();
|
start();
|
||||||
|
Loading…
Reference in New Issue
Block a user