Skip to content

Commit 1ae8533

Browse files
committed
fix: docker build
1 parent 56e7852 commit 1ae8533

File tree

5 files changed

+22
-2
lines changed

5 files changed

+22
-2
lines changed

deployment/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ ENV PORT="${PORT}"
77
ENV FUEL_PROVIDER="${FUEL_PROVIDER:-https://beta-5.fuel.network/graphql}"
88
ENV PNPM_HOME="/pnpm"
99
ENV PATH="$PNPM_HOME:$PATH"
10+
ENV SERVER_BUILD=true
1011

1112
# Enable pnpm using corepack form node.js
1213
RUN corepack enable

packages/graphql/.dockerignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_moduels
2+
.turbo
3+
dist

packages/graphql/README.md

+10
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,13 @@ This is a mock api for block-explorer
77
```sh
88
pnpm dev
99
```
10+
11+
## Docker images
12+
13+
```
14+
docker run \
15+
-e FUEL_PROVIDER=https://beta-5.fuel.network/graphql \
16+
-e SERVER_PORT=3000 \
17+
-p 3333:3000 \
18+
19+
```

packages/graphql/tsconfig.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
2-
"extends": "../../tsconfig.base.json",
2+
"$schema": "https://json.schemastore.org/tsconfig",
3+
"extends": "@fuels/ts-config/base.json",
34
"compilerOptions": {
45
"esModuleInterop": true,
56
"isolatedModules": true,
@@ -11,5 +12,6 @@
1112
}
1213
]
1314
},
15+
"exclude": ["node_modules"],
1416
"include": ["src", "scripts", "*.config.*", "codegen.*"]
1517
}

packages/graphql/tsup.config.mjs

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,22 @@ import { defineConfig } from 'tsup';
66
const graphqlLoaderPlugin = graphqlLoaderPluginPkg.default;
77
// Assign a single port for the process
88
const port = await getPort({ port: 4444 });
9+
const { SERVER_BUILD } = process.env;
10+
11+
const isServerBuild = SERVER_BUILD === 'true';
912

1013
export default defineConfig((options) => ({
1114
outDir: 'dist',
1215
splitting: true,
1316
format: ['esm', 'cjs'],
1417
sourcemap: true,
1518
clean: false,
16-
dts: true,
19+
dts: !isServerBuild,
1720
minify: false,
1821
esbuildPlugins: [graphqlLoaderPlugin()],
1922
entry: { index: 'src/bin/index.ts' },
2023
async onSuccess() {
24+
if (isServerBuild) return;
2125
const cmd = execa('node', ['--import', 'tsx/esm', './dist/index.js'], {
2226
stdio: 'inherit',
2327
cleanup: true,

0 commit comments

Comments
 (0)